-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63a438e
commit 76a06b0
Showing
6 changed files
with
72 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const IdPropertyName = 'element-6066-11e4-a52e-4f735466dfgh'; | ||
const saveScreenshot = require('../lib/saveScreenshot'); | ||
const getCurrentUrl = require('../lib/getCurrentUrl'); | ||
const acceptLocationAlertOnMobilesIfPresent = require('../lib/acceptLocationAlertOnMobilesIfPresent'); | ||
|
||
// See the WebDriver API documentation for a list of possible actions. | ||
// https://webdriver.io/docs/api.html | ||
// https://github.com/webdriverio/expect-webdriverio/blob/HEAD/docs/API.md | ||
|
||
// See the Mocha API for test structure: https://mochajs.org/ | ||
describe('Searching a shop', function() { | ||
it('delivers results', async function() { | ||
await browser.url('/'); | ||
|
||
await acceptLocationAlertOnMobilesIfPresent(); | ||
|
||
const $button = await $('button=Okay, let’s go!'); | ||
await $button.click(); | ||
|
||
const { capabilities } = browser; | ||
if (capabilities.platformName === 'iOS' || capabilities.platform === 'ANDROID') { | ||
const $searchButtonOnMobile = await $('.search-button'); | ||
await $searchButtonOnMobile.waitForExist(); | ||
await $searchButtonOnMobile.click(); | ||
} | ||
|
||
|
||
const $search = await $('[name="search"]'); | ||
await $search.click(); | ||
await (await $('[name="search"]')).addValue('Bötzowstr. 31'); | ||
$results = await $('.search-results'); | ||
await saveScreenshot('Search results are loading'); | ||
|
||
await browser.waitUntil(async () => { | ||
|
||
return $('.search-results').isExisting(); | ||
}); | ||
|
||
// Wait for wheelchair accessibility to be loaded | ||
await browser.waitUntil( | ||
async () => await (await $results.$('header.is-on-wheelmap=Bötzowstr. 31')).isDisplayed() | ||
); | ||
|
||
|
||
const $result = await $results.$('header=Bötzowstr. 31'); | ||
await expect($results).toBeDisplayedInViewport(); | ||
await saveScreenshot('Search results are displayed'); | ||
|
||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters