Difference between revisions of "Creating an Embedded Test Case"

From GXtest Wiki
Jump to: navigation, search
(Including the SearchClient Test Case in SeeClient)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Idiomas
+
{{Idiomas | Crear un Caso de Prueba Anidado | Creating an Embedded Test Case |埋め込みテストケースの作成}}
| Crear un Caso de Prueba Anidado
+
|Creating an Embedded Test Case
+
}}
+
 
__NOTOC__
 
__NOTOC__
 
[[category:GXtest Guides]]
 
[[category:GXtest Guides]]
Line 9: Line 6:
 
Many times there are a series of steps that are repeated within a Test Case.  When this is the case it is desirable to reuse Test Cases that already have the steps modeled. To accomplish this GXtest allows you to embed test cases.  
 
Many times there are a series of steps that are repeated within a Test Case.  When this is the case it is desirable to reuse Test Cases that already have the steps modeled. To accomplish this GXtest allows you to embed test cases.  
  
In the example you will modify the Test Case SeeCliente that was already created in the step [[Starting out with GXtest]].  
+
In the example you will modify the Test Case viewClient that was already created in the step [[Starting out with GXtest]].  
  
 
The idea is to separate it into two test cases:  
 
The idea is to separate it into two test cases:  
 
* SearchClient : that looks for the client and  
 
* SearchClient : that looks for the client and  
* SeeCliente: that once the client has been searched, view is clicked
+
* viewClient : that once the client has been searched, view is clicked
  
Conceptually, what you want to happen is that the Test Case SeeCliente is divided in the way that is shown in the following image:
+
Conceptually, what you want to happen is that the Test Case viewClient is divided in the way that is shown in the following image:
  
 
[[Image:DividirVerClientes.jpg]]
 
[[Image:DividirVerClientes.jpg]]
Line 23: Line 20:
 
Then enter the name SearchClient.
 
Then enter the name SearchClient.
  
== Copying elements from SeeClient to SearchClient ==
+
== Copying elements from viewClient to SearchClient ==
Go to the SeeClient Test Case and select the Home and Work With Clients nodes and the edge line the joins the two. Then press Ctrl+C. Then open the Test Case SearchClient and press Ctrl+V. All of the copied nodes will now appear in the SearchClient Test Case. Join the edge line Init to the Home node. Then add the DummyEvent event to the edge line Init. The Test Case ought to look like the following:
+
Go to the viewClient Test Case and select the Home and Work With Clients nodes and the edge line the joins the two. Then press Ctrl+C. Then open the Test Case SearchClient and press Ctrl+V. All of the copied nodes will now appear in the SearchClient Test Case. Join the edge line Init to the Home node. Then add the DummyEvent event to the edge line Init. The Test Case ought to look like the following:
  
 
[[Image:BuscarCliente.jpg]]
 
[[Image:BuscarCliente.jpg]]
  
== Including the SearchClient Test Case in SeeClient ==
+
== Including the SearchClient Test Case in viewClient ==
Now you can include the Test Case created before. Before anything else, open SeeClient and delete the Home node and the edge line that comes out of Home. Then delete the commands within Work With Clients.  
+
Now you can include the Test Case created before. Before anything else, open viewClient and delete the Home node and the edge line that comes out of Home. Then delete the commands within Work With Clients.  
  
 
Now drag the Test Case element from the left panel on the screen to where it will become part of the model. It will then display a window that allows you to choose the Test Case:
 
Now drag the Test Case element from the left panel on the screen to where it will become part of the model. It will then display a window that allows you to choose the Test Case:
Line 37: Line 34:
 
Choose the SearchClient Test Case. Join the Go edge line to the SearchClient element and add an edge line from the element to the Work With Clients node. Add a DummyEvent event to the edge line that connects the SearchClient Test Case to the Work With Clients node.  
 
Choose the SearchClient Test Case. Join the Go edge line to the SearchClient element and add an edge line from the element to the Work With Clients node. Add a DummyEvent event to the edge line that connects the SearchClient Test Case to the Work With Clients node.  
  
The Test Case SeeClient ought to look like the following:
+
The Test Case viewClient ought to look like the following:
  
 
[[Image:VerCliente_conBuscarClie.jpg]]
 
[[Image:VerCliente_conBuscarClie.jpg]]

Latest revision as of 01:55, 21 February 2014

Spanish.gif
English.gif
Japan.gif

Introduction

Many times there are a series of steps that are repeated within a Test Case. When this is the case it is desirable to reuse Test Cases that already have the steps modeled. To accomplish this GXtest allows you to embed test cases.

In the example you will modify the Test Case viewClient that was already created in the step Starting out with GXtest.

The idea is to separate it into two test cases:

  • SearchClient : that looks for the client and
  • viewClient : that once the client has been searched, view is clicked

Conceptually, what you want to happen is that the Test Case viewClient is divided in the way that is shown in the following image:

DividirVerClientes.jpg

Creating the SearchClient Test Case

To do this the first step is to create the SearchClient Test Case. To do so click on Test Cases > New. Then enter the name SearchClient.

Copying elements from viewClient to SearchClient

Go to the viewClient Test Case and select the Home and Work With Clients nodes and the edge line the joins the two. Then press Ctrl+C. Then open the Test Case SearchClient and press Ctrl+V. All of the copied nodes will now appear in the SearchClient Test Case. Join the edge line Init to the Home node. Then add the DummyEvent event to the edge line Init. The Test Case ought to look like the following:

BuscarCliente.jpg

Including the SearchClient Test Case in viewClient

Now you can include the Test Case created before. Before anything else, open viewClient and delete the Home node and the edge line that comes out of Home. Then delete the commands within Work With Clients.

Now drag the Test Case element from the left panel on the screen to where it will become part of the model. It will then display a window that allows you to choose the Test Case:

ChooseTestCaseWindow.jpg

Choose the SearchClient Test Case. Join the Go edge line to the SearchClient element and add an edge line from the element to the Work With Clients node. Add a DummyEvent event to the edge line that connects the SearchClient Test Case to the Work With Clients node.

The Test Case viewClient ought to look like the following:

VerCliente conBuscarClie.jpg

Testing the Test Case

The embedded test case is now ready. Run it!

See also