Skip to content

Commit

Permalink
Trying to stabilize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Waschnick authored and Waschnick committed Jul 9, 2018
1 parent 21de6aa commit 41ff26b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 35 deletions.
17 changes: 9 additions & 8 deletions test/e2e/advanced_settings_custom_purposes_test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { OIL_LAYER,
import {
OIL_LAYER,
OIL_YES_BUTTON,
OIL_ADVANCED_SETTINGS,
OIL_ADVANCED_SETTINGS_WRAPPER,
OIL_CUSTOM_PURPOSE_SLIDER,
OIL_ADVANCED_SETTINGS_CUSTOM_PURPOSE_HEADER } from '../test_constants.js';
OIL_ADVANCED_SETTINGS_CUSTOM_PURPOSE_HEADER
} from '../test_constants.js';

module.exports = {
'@disabled': false,
Expand All @@ -16,8 +18,8 @@ module.exports = {
'Shows five purposes by default': function (browser) {
browser
.url(browser.globals.launch_url_host1 + 'demos/advanced-settings.html')
.useCss()
.waitForElementVisible('body', 1000, false)
.useCss().waitForElementVisible('body', 1000, false)
.useXpath().waitForElementVisible(OIL_LAYER, 2000, false)
.useXpath().waitForElementVisible(OIL_YES_BUTTON, 3000, false)
.click(OIL_ADVANCED_SETTINGS)
.pause(200)
Expand All @@ -30,10 +32,9 @@ module.exports = {
'Displays custom purposes in list': function (browser) {
browser
.url(browser.globals.launch_url_host1 + 'demos/advanced-settings-custom-purposes.html')
.useCss()
.waitForElementVisible('body', 1000, false)
.useXpath()
.waitForElementVisible(OIL_YES_BUTTON, 3000, false)
.useCss().waitForElementVisible('body', 1000, false)
.useXpath().waitForElementVisible(OIL_LAYER, 2000, false)
.useXpath().waitForElementVisible(OIL_YES_BUTTON, 3000, false)
.click(OIL_ADVANCED_SETTINGS)
.pause(200)
.waitForElementVisible(OIL_ADVANCED_SETTINGS_WRAPPER, 2000, false)
Expand Down
10 changes: 3 additions & 7 deletions test/e2e/auto_hide_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ module.exports = {
browser
.url(browser.globals.launch_url_host1 + 'demos/auto-hide.html')
.deleteCookies();

browser
.url(browser.globals.launch_url_host1 + 'demos/auto-hide.html')
.useCss()
.waitForElementVisible('body', 1000, false)
.useXpath()
.waitForElementVisible(OIL_LAYER, 2000, false);
},

'OIL Layer should be auto-hidden after the correct amount of time': function (browser) {
browser
.url(browser.globals.launch_url_host1 + 'demos/auto-hide.html')
.useCss().waitForElementVisible('body', 1000, false)
.useXpath().waitForElementVisible(OIL_LAYER, 2000, false)
.pause(2000)
.useXpath().waitForElementNotPresent(OIL_LAYER, 4000)
.end();
Expand Down
9 changes: 4 additions & 5 deletions test/e2e/direct_integration_event_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ module.exports = {
browser
.url(browser.globals.launch_url_host1 + 'demos/direct-integration-event-test.html')
.deleteCookies();

browser
.url(browser.globals.launch_url_host1 + 'demos/direct-integration-event-test.html')
.useCss().waitForElementVisible('body', 1000, false)
.useXpath().waitForElementVisible(OIL_LAYER, 2000, false);
},

'OIL Layer event being sent after clicking yes, even after refresh': function (browser) {
browser
.url(browser.globals.launch_url_host1 + 'demos/direct-integration-event-test.html')
.useCss().waitForElementVisible('body', 1000, false)
.useXpath().waitForElementVisible(OIL_LAYER, 2000, false)
.waitForElementVisible(OIL_YES_BUTTON, 2000, false)
.assert.cssClassPresent(EVENT_NOTIFIER_DIV, 'event-notifier-hidden')
.click(OIL_YES_BUTTON)
.waitForElementNotPresent(OIL_LAYER, 1000)
Expand Down
22 changes: 7 additions & 15 deletions test/e2e/direct_integration_soi_optout_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,24 @@ module.exports = {
browser
.url(browser.globals.launch_url_host1 + 'demos/direct-integration-opt-out-event-test.html')
.deleteCookies();

browser
.url(browser.globals.launch_url_host1 + 'demos/direct-integration-opt-out-event-test.html')
.useCss()
.waitForElementVisible('body', 1000, false)
.useXpath()
.waitForElementVisible(OIL_LAYER, 2000, false);
},

'OIL Layer Site Opt-In clicked, verify opt-in, opt-out by event': function (browser) {
browser
.url(browser.globals.launch_url_host1 + 'demos/direct-integration-opt-out-event-test.html')
.useCss().waitForElementVisible('body', 1000, false)
.useXpath().waitForElementVisible(OIL_LAYER, 2000, false)
.click(OIL_YES_BUTTON)
.pause(200)
.waitForElementNotPresent(OIL_LAYER, 1000)
.refresh()
.useCss()
.waitForElementVisible('body', 1000, false)
.useXpath()
.useCss().waitForElementVisible('body', 1000, false)
.pause(500)
.waitForElementNotPresent(OIL_LAYER, 1000)
.useXpath().waitForElementNotPresent(OIL_LAYER, 1000)
.click(HOST_SEND_OPTOUT_BUTTON)
.refresh()
.useCss()
.waitForElementVisible('body', 1000, false)
.useXpath()
.waitForElementVisible(OIL_LAYER, 2000, false)
.useCss().waitForElementVisible('body', 1000, false)
.useXpath().waitForElementVisible(OIL_LAYER, 2000, false)
.end();
}
};

0 comments on commit 41ff26b

Please sign in to comment.