Skip to content

Commit

Permalink
Merge pull request josdejong#31 from accumatic/login_for_demo
Browse files Browse the repository at this point in the history
Login for demo
  • Loading branch information
anzud authored Mar 24, 2020
2 parents f35cdb3 + ba7b2ab commit c57f0f3
Show file tree
Hide file tree
Showing 96 changed files with 11,053 additions and 1,502 deletions.
36 changes: 36 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2.1

orbs:
docker: circleci/docker@1.0.0

jobs:
e2e-tests:
executor: docker/docker
working_directory: ~/project

steps:
- checkout:
path: ~/project
- setup_remote_docker
- run:
name: Pull docker images
command: docker-compose -f docker-compose.ci.yml pull
no_output_timeout: 1m
- run:
name: Build docker images
command: docker-compose -f docker-compose.ci.yml build
no_output_timeout: 2m
- run:
name: Run tests
command: docker-compose -f docker-compose.ci.yml up --abort-on-container-exit --exit-code-from node
no_output_timeout: 2m
- run:
name: Copy report
command: docker cp e2e-tests-container:/usr/app/report/cucumber/html/. ~/report
- store_artifacts:
path: ~/report

workflows:
e2e-tests:
jobs:
- e2e-tests
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode
node_modules
report
.dockerignore
.gitignore
Dockerfile
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELENIUM_VERSION=3.141.59-zirconium
SCREEN_WIDTH=1280
SCREEN_HEIGHT=720
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
rules: {
},
};
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Pull docker images
run: docker-compose -f docker-compose.ci.yml pull

- name: Build docker images
run: docker-compose -f docker-compose.ci.yml build

- name: Run tests
run: docker-compose -f docker-compose.ci.yml up --abort-on-container-exit --exit-code-from node

- uses: actions/upload-artifact@v1
with:
name: report
path: report
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
dist
report
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: node_js

services:
- docker

before_install:
- docker-compose -f docker-compose.ci.yml pull

install:
- docker-compose -f docker-compose.ci.yml build

script:
- docker-compose -f docker-compose.ci.yml up --abort-on-container-exit --exit-code-from node
64 changes: 64 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug current test",
"type": "node",
"request": "launch",
"args": ["wdio.conf.js", "--spec", "${file}"],
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
"console": "integratedTerminal",
"env": {
"DEBUG_TESTS": "true",
"VNC_SUPPORT": "false"
},
},
{
"name": "Debug all tests",
"type": "node",
"request": "launch",
"args": ["wdio.conf.js", "--spec"],
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
"console": "integratedTerminal",
"env": {
"DEBUG_TESTS": "true",
"VNC_SUPPORT": "false"
},
},
{
"name": "VNC Debug current test",
"type": "node",
"request": "launch",
"args": ["wdio.conf.js", "--spec", "${file}"],
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
"console": "integratedTerminal",
"env": {
"DEBUG_TESTS": "true",
"VNC_SUPPORT": "true"
},
},
{
"name": "VNC Debug all tests",
"type": "node",
"request": "launch",
"args": ["wdio.conf.js", "--spec"],
"cwd": "${workspaceFolder}",
"autoAttachChildProcesses": true,
"program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
"console": "integratedTerminal",
"env": {
"DEBUG_TESTS": "true",
"VNC_SUPPORT": "true"
},
},
]
}
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"typescript.tsdk": "./node_modules/typescript/lib",
"files.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/dist": true,
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.renderWhitespace": "all",
"editor.acceptSuggestionOnEnter": "off"
},
"editor.autoIndent": "full",
"typescript.preferences.importModuleSpecifier": "relative",
}
57 changes: 57 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "selenium: start",
"type": "shell",
"command": "npm run selenium",
"group": "build",
"problemMatcher": [
"$tsc"
],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "selenium: start vnc",
"type": "shell",
"command": "npm run selenium:vnc",
"group": "build",
"problemMatcher": [
"$tsc"
],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "selenium: stop",
"type": "shell",
"command": "npm run selenium:stop",
"group": "build",
"problemMatcher": [
"$tsc"
],
"presentation": {
"reveal": "always",
"panel": "shared"
}
},
{
"label": "test",
"type": "shell",
"command": "npm run test",
"group": "test",
"problemMatcher": [
"$tsc"
],
"presentation": {
"reveal": "always",
"panel": "new"
},
}
]
}
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:12
LABEL maintainer="Labs42"

WORKDIR /usr/app

ADD ./scripts/wait-for-it.sh ./
RUN chmod 755 wait-for-it.sh
ADD ./scripts/run.sh ./
RUN chmod 755 run.sh

ADD ./package.json package.json
ADD ./package-lock.json package-lock.json

RUN npm ci
ADD ./.env ./
ADD ./tsconfig.json ./
ADD ./.eslintrc.js ./
ADD ./wdio.conf.js ./
ADD ./cucumber.report.conf.js ./
ADD ./config config
ADD ./src src
RUN npm run lint

CMD [ "./run.sh"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Labs42 <hello@labs42.io>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Project with scenarios for 'end-to-end' tests Accumatic Dash

Installing:
1. npm i
2. ./node_modules/.bin/wdio config -y
1. Install Docker to your PC
2. Execute "npm i" in project folder
3. Dowmload and unzip webdriver from https://sites.google.com/a/chromium.org/chromedriver/downloads to some local folder
4. Specify PATH, on windows you able use Command Prompt with admin rights: setx /m path "%path%;C:\WebDriver"

Running:
npm run e2e
npm run selenium
npm run e2e
npm run selenium:stop - after complete tests
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};
20 changes: 20 additions & 0 deletions config/chrome.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const capabilitiesChromeConfig = {
'maxInstances': 1,
'browserName': 'chrome',
'goog:chromeOptions': {
args: [
'--no-sandbox',
].concat(
process.env.VNC_SUPPORT === 'true' ? [
// When debugging with VNC support headless mode is not enabled
// to allow viewing actions in the browser.
] : [
'--headless',
'--disable-gpu',
],
),
},
'cjson:metadata': {
device: process.env.SELENIUM_VERSION,
},
};
20 changes: 20 additions & 0 deletions config/firefox.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// https://github.com/mozilla/geckodriver/blob/master/README.md#firefox-capabilities

export const capabilitiesFirefoxConfig = {
// 'maxInstances': 0,
// 'browserName': 'firefox',
// 'moz:firefoxOptions': {
// args: [].concat(
// process.env.VNC_SUPPORT === 'true' ? [
// // When debugging with VNC support headless mode is not enabled
// // to allow viewing actions in the browser.
// ] : [

// '-headless',
// ]),
// },
// 'acceptInsecureCerts': true,
// 'cjson:metadata': {
// device: process.env.SELENIUM_VERSION,
// },
};
Loading

0 comments on commit c57f0f3

Please sign in to comment.