Skip to content

Commit

Permalink
feat(e2e): Correction to work on drone ci
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix741 committed Jan 10, 2018
1 parent 31e56b3 commit d869e9b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
23 changes: 17 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
pipeline:
test:
e2e:
group: test
image: node:8
commands:
- npm install
- npm run e2e:docker
environment:
- MONGODB_HOST=mongodb://mongodb:27017/passprotect
- MONGODB_DATABASE=passprotect
- HOST=e2e

unit:
group: test
image: node:8
commands:
- wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
Expand All @@ -8,21 +20,20 @@ pipeline:

- npm install
- npm run unit
- npm run e2e:docker
environment:
- MONGODB_HOST=mongodb://mongodb:27017/passprotect
- MONGODB_DATABASE=passprotect
- HOST=test

nodejs:
group: build
image: plugins/docker
repo: phoenix741/passprotect-server
secrets: [ docker_username, docker_password ]
tags: develop
dockerfile: Dockerfile.nodejs

nginx:
group: build
image: plugins/docker
repo: phoenix741/passprotect-client
secrets: [ docker_username, docker_password ]
tags: develop
dockerfile: Dockerfile.nginx

Expand Down
4 changes: 2 additions & 2 deletions docker-compose-selenium.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: '2'
services:
test:
e2e:
image: node:8
command: /bin/bash
volumes:
- ./:/src
environment:
- MONGODB_HOST=mongodb://mongodb:27017/passprotect
- MONGODB_DATABASE=passprotect
- HOST=test
- HOST=e2e
stdin_open: true
tty: true

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/nightwatch.docker.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = _.merge({}, nightwatch, {
selenium_host: 'selenium',
silent: true,
globals: {
devServerURL: 'http://test:' + (process.env.PORT || config.dev.port)
devServerURL: 'http://e2e:' + (process.env.PORT || config.dev.port)
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions test/e2e/pages/ItemsPage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const WAIT_TIMEOUT = 5000
const WAIT_TIMEOUT = 20000

module.exports = {
elements: {
Expand Down Expand Up @@ -78,6 +78,8 @@ module.exports = {

assertItem (indice, title, type) {
this
.waitForElementPresent(`#items-list > li:nth-child(${indice}) .line-title`, WAIT_TIMEOUT)

.assert.containsText(`#items-list > li:nth-child(${indice}) .line-title`, title)
.assert.containsText(`#items-list > li:nth-child(${indice}) .line-type`, type)
return this.api
Expand All @@ -86,8 +88,9 @@ module.exports = {
assertItemWithGroup (indice, group, title, type) {
this
.waitForElementVisible('@search', WAIT_TIMEOUT)
.waitForElementPresent(`#items-list > li:nth-child(${indice}).subheader`, WAIT_TIMEOUT)

.assert.containsText(`#items-list > li:nth-child(${indice})`, group)
.assert.containsText(`#items-list > li:nth-child(${indice}).subheader`, group)
.assertItem(indice + 1, title, type)
return this.api
},
Expand Down

0 comments on commit d869e9b

Please sign in to comment.