Skip to content

Commit 56a1f45

Browse files
timdavishbbmoz
authored andcommitted
Chore/#155363724 - Make e2e tests more stable (#178)
* chore: make e2e more stable * chore: update yarn.lock
1 parent 221cbe2 commit 56a1f45

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

e2e/smoke.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Feature: Smoke Tests
4040
And I do not see the project with the project details <name>
4141
When I click the "home" header link
4242
Then I am on the "home" page
43+
And I see the project with the project details <name>
4344
When I apply to a project with the project details <name>
4445
And I click the "profile" header link
4546
Then I am on the "profile" page

e2e/step_definitions/steps.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,18 @@ When(/^I create a project with the project details (.*?)$/, async name => {
5050
})
5151

5252
When(/^I apply to a project with the project details (.*?)$/, 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
5757
})
5858

5959
Then(/^I do not see the project with the project details (.*?)$/, 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)
6362
})
6463

6564
Then(/^I see the project with the project details (.*?)$/, 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)
6967
})

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3305,9 +3305,9 @@ escope@^3.6.0:
33053305
esrecurse "^4.1.0"
33063306
estraverse "^4.1.1"
33073307

3308-
eslint-config-standard@^10.2.1:
3309-
version "10.2.1"
3310-
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz#c061e4d066f379dc17cd562c64e819b4dd454591"
3308+
eslint-config-standard@^11.0.0:
3309+
version "11.0.0"
3310+
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz#87ee0d3c9d95382dc761958cbb23da9eea31e0ba"
33113311

33123312
eslint-import-resolver-node@^0.3.1:
33133313
version "0.3.2"

0 commit comments

Comments
 (0)