-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #5 Ability to start from a project sample
- Loading branch information
Showing
29 changed files
with
557 additions
and
3 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
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,22 @@ | ||
'use strict'; | ||
|
||
const merge = require('merge'); | ||
|
||
let config = require('./part/all'); | ||
config = merge.recursive(true, require('./part/docker'), config); | ||
config = merge.recursive(true, require('./part/chrome'), config); | ||
config = merge.recursive(true, | ||
{ | ||
reporterOptions: { | ||
json: { | ||
outputDir: 'output-json/all-docker-chrome/', | ||
filename: 'report', | ||
combined: 'true', | ||
}, | ||
}, | ||
host: 'chrome', | ||
}, | ||
config); | ||
config = merge.recursive(true, require('../../wdio.conf').config, config); | ||
|
||
exports.config = config; |
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,23 @@ | ||
'use strict'; | ||
|
||
const merge = require('merge'); | ||
|
||
let config = require('./part/all'); | ||
config = merge.recursive(true, require('./part/docker'), config); | ||
config = merge.recursive(true, require('./part/firefox'), config); | ||
config = merge.recursive( | ||
true, | ||
{ | ||
reporterOptions: { | ||
json: { | ||
outputDir: 'output-json/all-docker-firefox/', | ||
filename: 'report', | ||
combined: 'true', | ||
}, | ||
}, | ||
host: 'firefox', | ||
}, | ||
config); | ||
config = merge.recursive(true, require('../../wdio.conf').config, config); | ||
|
||
exports.config = config; |
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,7 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
specs: [ | ||
'./src/features/**/*.feature', | ||
], | ||
}; |
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,39 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
capabilities: [ | ||
{ | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
// args: ['--headless'], | ||
prefs: { | ||
profile: { | ||
default_content_setting_values: { images: 2 }, // Do not load images for tests to run faster | ||
password_manager_enabled: false, // Deactivate password manager | ||
}, | ||
credentials_enable_service: false, // Deactivate password manager | ||
}, | ||
}, | ||
}, | ||
], | ||
|
||
// seleniumInstallArgs: { | ||
// proxy: 'http://localhost:3128', | ||
// drivers: { | ||
// chrome: { | ||
// version: '2.43', | ||
// arch: process.arch, | ||
// baseURL: 'https://chromedriver.storage.googleapis.com', | ||
// }, | ||
// }, | ||
// }, | ||
// seleniumArgs: { | ||
// drivers: { | ||
// chrome: { | ||
// version: '2.43', | ||
// arch: process.arch, | ||
// }, | ||
// }, | ||
// }, | ||
|
||
}; |
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,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
services: [], | ||
}; |
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,33 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
capabilities: [ | ||
{ | ||
browserName: 'firefox', | ||
acceptInsecureCerts: true, | ||
// "moz:firefoxOptions": { | ||
// args: ['-headless'], | ||
// } | ||
}, | ||
], | ||
|
||
// seleniumInstallArgs: { | ||
// proxy: 'http://localhost:3128', | ||
// drivers: { | ||
// firefox: { | ||
// version: '0.23.0', | ||
// arch: process.arch, | ||
// baseURL: 'https://github.com/mozilla/geckodriver/releases/download', | ||
// }, | ||
// }, | ||
// }, | ||
// seleniumArgs: { | ||
// drivers: { | ||
// firefox: { | ||
// version: '0.23.0', | ||
// arch: process.arch, | ||
// }, | ||
// }, | ||
// }, | ||
|
||
}; |
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,8 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
export RUN_AS_UID=$(id -u) | ||
|
||
docker-compose up --build --exit-code-from sample-project | ||
docker-compose down |
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,23 @@ | ||
version: '3' | ||
services: | ||
chrome: | ||
image: selenium/standalone-chrome:3.14.0 | ||
container_name: chrome | ||
environment: | ||
- JAVA_OPTS=-Dselenium.LOGGER.level=WARNING | ||
firefox: | ||
image: selenium/standalone-firefox:3.14.0 | ||
container_name: firefox | ||
environment: | ||
- JAVA_OPTS=-Dselenium.LOGGER.level=WARNING | ||
sample-project: | ||
image: node:8 | ||
container_name: sample-project | ||
command: /data/docker/run-sample-project-docker.sh | ||
volumes: | ||
- ../.:/data | ||
environment: | ||
- RUN_AS_UID=${RUN_AS_UID} | ||
depends_on: | ||
- firefox | ||
- chrome |
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,17 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
cd /data | ||
|
||
echo "Installing sample project dependencies..." | ||
npm install | ||
echo "Sample project dependencies installed." | ||
|
||
echo "Running end-to-end tests on all-docker-chrome realm..." | ||
npx etaf run --realm='all-docker-chrome' | ||
echo "End-to-end tests run on all-docker-chrome realm." | ||
|
||
echo "Running end-to-end tests on all-docker-firefox realm..." | ||
npx etaf run --realm='all-docker-firefox' | ||
echo "End-to-end tests run on all-docker-firefox realm." |
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,13 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if id "testrunner" >/dev/null 2>&1; then | ||
echo "User 'testrunner' already exists." | ||
else | ||
echo "Creating user 'testrunner'..." | ||
useradd -u $RUN_AS_UID -o -m -p $(echo testrunner | openssl passwd -1 -stdin) testrunner | ||
echo "User 'testrunner' created." | ||
fi | ||
|
||
su testrunner -c '/data/docker/run-sample-project-docker-ft.sh' |
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,21 @@ | ||
Feature: Navigate | ||
|
||
Scenario Outline: Navigate directly to URL | ||
When I go to the <page> page | ||
Then I should be on the <page> page | ||
Examples: | ||
| page | | ||
| home | | ||
| search | | ||
| results | | ||
| contact | | ||
|
||
@smoke | ||
Scenario Outline: Navigate from the home page menu | ||
When I am on the home page | ||
When I go to the <page> page from the home page menu | ||
Then I should be on the <page> page | ||
Examples: | ||
| page | | ||
| search | | ||
| contact | |
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,27 @@ | ||
Feature: Search engine | ||
|
||
Background: | ||
Given I am on the search page | ||
|
||
@smoke | ||
Scenario: Search for something and land on the results page | ||
When I search for something | ||
Then I should be on the results page | ||
|
||
@smoke | ||
Scenario: Search for something that exists and see some results | ||
When I search for something that exists | ||
Then I should be on the results page | ||
And I should see some results | ||
|
||
@smoke | ||
Scenario: Search for something that does not exist and see no results | ||
When I search for something that does not exist | ||
Then I should be on the results page | ||
And I should be told that no results have been found | ||
|
||
@query-reminder | ||
Scenario: Be reminded the search query on the results page | ||
When I search for something | ||
Then I should be on the results page | ||
And I should be reminded what I searched for |
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,25 @@ | ||
'use strict'; | ||
|
||
const { defineSupportCode } = require('cucumber'); | ||
|
||
defineSupportCode(function ({ Given, When, Then }) { | ||
|
||
Given(/^I am on the (.+) page$/, function (pageName) { | ||
return browser | ||
.goToPage(pageName) | ||
.seePage(pageName); | ||
}); | ||
|
||
When(/^I go to the (.+) page$/, function (pageName) { | ||
return browser.goToPage(pageName); | ||
}); | ||
|
||
When(/^I go to the (.+) page from the home page menu$/, function (pageName) { | ||
return browser.goToPageFromHomePageMenu(pageName); | ||
}); | ||
|
||
Then(/^I should be on the (.+) page$/, function (pageName) { | ||
return browser.seePage(pageName); | ||
}); | ||
|
||
}); |
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,39 @@ | ||
'use strict'; | ||
|
||
require('src/support/business-object/search.bo'); | ||
|
||
const { defineSupportCode } = require('cucumber'); | ||
|
||
defineSupportCode(function ({ Before, Given, When, Then }) { | ||
|
||
let query = require('src/support/data/search/search-for-something.data'); | ||
|
||
Before({ tags: '@query-reminder' }, function() { | ||
query = require('src/support/data/search/search-for-something-query-reminder.data'); | ||
}); | ||
|
||
When(/^I search for something$/, function () { | ||
return browser.search(query); | ||
}); | ||
|
||
When(/^I search for something that does not exist$/, function () { | ||
return browser.searchForSomethingThatDoesNotExist(); | ||
}); | ||
|
||
When(/^I search for something that exists$/, function () { | ||
return browser.searchForSomethingThatExists(); | ||
}); | ||
|
||
Then(/^I should see some results$/, function () { | ||
return browser.seeResults(); | ||
}); | ||
|
||
Then(/^I should be told that no results have been found$/, function () { | ||
return browser.seeNoResults(); | ||
}); | ||
|
||
Then(/^I should be reminded what I searched for$/, function () { | ||
return browser.seeSearchQuery(query); | ||
}); | ||
|
||
}); |
Oops, something went wrong.