File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { Selector } from 'testcafe' ;
2+
3+ fixture ( 'create-testplan-inactive-private' ) . page ( process . env . TL_URL ) ;
4+
5+ const fake = require ( 'faker' ) ;
6+ let name = fake . commerce . productName ( ) ;
7+ let active = '0' ;
8+ let is_public = '0' ;
9+
10+ test ( 'create-testplan' , async t => {
11+ await t
12+ . typeText ( Selector ( '#tl_login' ) , 'admin' )
13+ . typeText ( Selector ( '#tl_password' ) , 'admin' )
14+ . pressKey ( 'enter' )
15+ . switchToIframe ( Selector ( '[name="mainframe"].siteContent' ) )
16+ . click ( Selector ( 'a' ) . withText ( 'Test Plan Management' ) )
17+ . click ( Selector ( '[name="bottomCreateForm"]' ) . find ( '[name="create_testplan"]' ) ) ;
18+
19+ /* fill the form */
20+ await t
21+ . typeText ( Selector ( '#testplan_mgmt' ) . find ( '[name="testplan_name"]' ) , name ) ;
22+
23+ if ( active == '1' ) {
24+ await t
25+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="active"]' ) ) ;
26+ }
27+ if ( is_public == '1' ) {
28+ await t
29+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="is_public"]' ) )
30+ }
31+
32+ await t
33+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="do_create"]' ) ) ;
34+
35+ /* checks */
36+ let row = Selector ( 'tr' ) . withAttribute ( 'data-qa-tplan-name' , name ) ;
37+ await t
38+ . expect ( row . visible ) . ok ( )
39+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-active' , active ) . visible ) . ok ( )
40+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-is_public' , is_public ) . visible ) . ok ( ) ;
41+ } ) ;
Original file line number Diff line number Diff line change 1+ import { Selector } from 'testcafe' ;
2+
3+ fixture ( 'create-testplan-inactive-public' ) . page ( process . env . TL_URL ) ;
4+
5+ const fake = require ( 'faker' ) ;
6+ let name = fake . commerce . productName ( ) ;
7+ let active = '0' ;
8+ let is_public = '1' ;
9+
10+ test ( 'create-testplan' , async t => {
11+ await t
12+ . typeText ( Selector ( '#tl_login' ) , 'admin' )
13+ . typeText ( Selector ( '#tl_password' ) , 'admin' )
14+ . pressKey ( 'enter' )
15+ . switchToIframe ( Selector ( '[name="mainframe"].siteContent' ) )
16+ . click ( Selector ( 'a' ) . withText ( 'Test Plan Management' ) )
17+ . click ( Selector ( '[name="bottomCreateForm"]' ) . find ( '[name="create_testplan"]' ) ) ;
18+
19+ /* fill the form */
20+ await t
21+ . typeText ( Selector ( '#testplan_mgmt' ) . find ( '[name="testplan_name"]' ) , name ) ;
22+
23+ if ( active == '1' ) {
24+ await t
25+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="active"]' ) ) ;
26+ }
27+ if ( is_public == '1' ) {
28+ await t
29+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="is_public"]' ) )
30+ }
31+
32+ await t
33+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="do_create"]' ) ) ;
34+
35+ /* checks */
36+ let row = Selector ( 'tr' ) . withAttribute ( 'data-qa-tplan-name' , name ) ;
37+ await t
38+ . expect ( row . visible ) . ok ( )
39+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-active' , active ) . visible ) . ok ( )
40+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-is_public' , is_public ) . visible ) . ok ( ) ;
41+ } ) ;
You can’t perform that action at this time.
0 commit comments