@@ -3,16 +3,14 @@ const { Given, Then, When } = require('cucumber')
3
3
4
4
Given ( / ^ I a m l o g g e d o u t $ / , async ( ) => {
5
5
const header = client . page . header ( )
6
- await client . pause ( 250 )
7
- await header . expect . element ( '@loginButton' ) . to . be . visible
8
- await header . expect . element ( '@signupButton' ) . to . be . visible
6
+ await header . waitForElementVisible ( '@loginButton' , 2500 )
7
+ await header . waitForElementVisible ( '@signupButton' , 2500 )
9
8
} )
10
9
11
10
Given ( / ^ I a m l o g g e d i n $ / , async ( ) => {
12
11
const header = client . page . header ( )
13
- await client . pause ( 250 )
14
- await header . expect . element ( '@loginButton' ) . to . not . be . present
15
- await header . expect . element ( '@signupButton' ) . to . not . be . present
12
+ await header . waitForElementNotPresent ( '@loginButton' , 2500 )
13
+ await header . waitForElementNotPresent ( '@signupButton' , 2500 )
16
14
} )
17
15
18
16
Given ( / ^ I o p e n t h e " ( .* ) " p a g e $ / , async selector => {
@@ -22,7 +20,7 @@ Given(/^I open the "(.*)" page$/, async selector => {
22
20
23
21
Then ( / ^ I a m o n t h e " ( .* ) " p a g e $ / , async selector => {
24
22
const page = client . page [ selector ] ( )
25
- await page . waitForElementVisible ( '@body' , 1000 )
23
+ await page . waitForElementVisible ( '@body' , 2500 )
26
24
await client . assert . urlEquals ( page . url )
27
25
} )
28
26
@@ -52,11 +50,13 @@ When(/^I apply to a project with the project details (.*?)$/, async name => {
52
50
} )
53
51
54
52
Then ( / ^ I d o n o t s e e t h e p r o j e c t w i t h t h e p r o j e c t d e t a i l s ( .* ?) $ / , async name => {
55
- const createProject = client . page . createProject ( )
56
- await createProject . expect . element ( '@body' ) . text . to . not . contain ( name )
53
+ const profile = client . page . profile ( )
54
+ await profile . waitForElementPresent ( '@body' , 2500 )
55
+ await profile . expect . element ( '@body' ) . text . to . not . contain ( name )
57
56
} )
58
57
59
58
Then ( / ^ I s e e t h e p r o j e c t w i t h t h e p r o j e c t d e t a i l s ( .* ?) $ / , async name => {
60
- const createProject = client . page . createProject ( )
61
- await createProject . expect . element ( '@body' ) . text . to . contain ( name )
59
+ const profile = client . page . profile ( )
60
+ await profile . waitForElementPresent ( '@body' , 2500 )
61
+ await profile . expect . element ( '@body' ) . text . to . contain ( name )
62
62
} )
0 commit comments