@@ -50,20 +50,18 @@ When(/^I create a project with the project details (.*?)$/, async name => {
50
50
} )
51
51
52
52
When ( / ^ I a p p l y t o a 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 => {
53
- const home = client . page . home ( )
54
- await home . expect . element ( '@body' ) . text . to . contain ( name )
55
- await client . useXpath ( ) . click ( `//div[text()=" ${ name } "]` )
56
- await client . pause ( 250 ) // Need this pause for some reason
53
+ const selector = `//div[text()=" ${ name } "]`
54
+ await client . useXpath ( ) . waitForElementVisible ( selector , 2500 )
55
+ await client . useXpath ( ) . click ( selector )
56
+ await client . pause ( 1250 ) // Need this pause for some reason
57
57
} )
58
58
59
59
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 => {
60
- const profile = client . page . profile ( )
61
- await profile . waitForElementPresent ( '@body' , 2500 )
62
- await profile . expect . element ( '@body' ) . text . to . not . contain ( name )
60
+ const selector = `//div[text()="${ name } "]`
61
+ await client . useXpath ( ) . waitForElementNotPresent ( selector , 2500 )
63
62
} )
64
63
65
64
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 => {
66
- const profile = client . page . profile ( )
67
- await profile . waitForElementPresent ( '@body' , 2500 )
68
- await profile . expect . element ( '@body' ) . text . to . contain ( name )
65
+ const selector = `//div[text()="${ name } "]`
66
+ await client . useXpath ( ) . waitForElementVisible ( selector , 2500 )
69
67
} )
0 commit comments