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-active-private' ) . page ( process . env . TL_URL ) ;
4+
5+ const fake = require ( 'faker' ) ;
6+ let name = fake . commerce . productName ( ) ;
7+ let active = '1' ;
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+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="active"]' ) )
23+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="do_create"]' ) ) ;
24+
25+ /* checks */
26+ let row = Selector ( 'tr' ) . withAttribute ( 'data-qa-tplan-name' , name ) ;
27+ await t
28+ . expect ( row . visible ) . ok ( )
29+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-active' , active ) . visible ) . ok ( )
30+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-is_public' , is_public ) . visible ) . ok ( ) ;
31+ } ) ;
Original file line number Diff line number Diff line change 1+ import { Selector } from 'testcafe' ;
2+
3+ fixture ( 'create-testplan-active-public' ) . page ( process . env . TL_URL ) ;
4+
5+ const fake = require ( 'faker' ) ;
6+ let name = fake . commerce . productName ( ) ;
7+ let active = '1' ;
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+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="active"]' ) )
23+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="is_public"]' ) )
24+ . click ( Selector ( '#testplan_mgmt' ) . find ( '[name="do_create"]' ) ) ;
25+
26+ /* checks */
27+ let row = Selector ( 'tr' ) . withAttribute ( 'data-qa-tplan-name' , name ) ;
28+ await t
29+ . expect ( row . visible ) . ok ( )
30+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-active' , active ) . visible ) . ok ( )
31+ . expect ( row . find ( 'td' ) . withAttribute ( 'data-qa-is_public' , is_public ) . visible ) . ok ( ) ;
32+ } ) ;
You can’t perform that action at this time.
0 commit comments