Run cypress workflow without docker

Runs the cypress workflow directly without docker
This commit is contained in:
Sean 2021-11-23 22:47:49 +01:00
parent 3adea03883
commit 693e116222
10 changed files with 249 additions and 47 deletions

View File

@ -4,7 +4,7 @@ on: [push, pull_request]
jobs: jobs:
run-cypress: run-cypress:
name: "Runs integration tests in cypress" name: 'Runs integration tests in cypress'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code - name: Check out code
@ -15,8 +15,11 @@ jobs:
- name: Build and run OS4 Dev - name: Build and run OS4 Dev
run: make run-dev ARGS="-d" run: make run-dev ARGS="-d"
- name: Run integration tests (cypress docker) - name: Run integration tests (cypress)
run: make cypress-docker uses: cypress-io/github-action@v2
with:
- name: Stop OS4 working-directory: integration
run: make stop-dev wait-on: 'https://localhost:8000'
wait-on-timeout: 300
env:
NODE_TLS_REJECT_UNAUTHORIZED: 0

View File

@ -1,9 +1,12 @@
FROM cypress/included:8.4.0 FROM cypress/base:10
WORKDIR /app WORKDIR /app
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN npm ci
COPY ./cypress ./cypress/
COPY ./cypress-docker.json ./cypress.json COPY ./cypress-docker.json ./cypress.json
COPY ./resource-config-docker.js ./resource-config.js
COPY ./cypress ./cypress/
COPY entrypoint.sh /usr/local/bin/entrypoint CMD ["npm", "run", "cypress:run"]
ENTRYPOINT entrypoint

View File

@ -1,3 +1,3 @@
{ {
"baseUrl": "https://host.docker.internal:8000" "baseUrl": "https://host.docker.internal:8000"
} }

View File

@ -1,6 +1,6 @@
{ {
"baseUrl": "https://localhost:8000", "baseUrl": "https://localhost:8000",
"screenshotsFolder": "results/screenshots", "screenshotsFolder": "results/screenshots",
"videosFolder": "results/videos", "videosFolder": "results/videos",
"downloadsFolder": "results/downloads" "downloadsFolder": "results/downloads"
} }

View File

@ -1,4 +1,4 @@
describe("Update a committee", () => { describe('Update a committee', () => {
let committeeName; let committeeName;
let committeeId; let committeeId;
@ -10,16 +10,16 @@ describe("Update a committee", () => {
name: committeeName, name: committeeName,
manager_ids: [1], manager_ids: [1],
}; };
cy.os4request("committee.create", committeeData).then((res) => { cy.os4request('committee.create', committeeData).then((res) => {
committeeId = res.id; committeeId = res.id;
}); });
cy.visit("/committees/"); cy.visit('/committees/');
}); });
it("Has new Committee", () => { it('Has new Committee', () => {
cy.visit(`/committees/${committeeId}`); cy.visit(`/committees/${committeeId}`);
cy.url().should("include", committeeId); cy.url().should('include', committeeId);
cy.get("h1").contains(committeeName); cy.get('h1').contains(committeeName);
}); });
/** /**

View File

@ -1,22 +0,0 @@
#!/bin/bash
# -------------------------------------------------------------------
# Copyright (C) 2020 by Intevation GmbH
# Author(s):
# Sean Engelhardt <sean.engelhardt@intevation.de>
#
# This program is distributed under the MIT license, as described
# in the LICENSE file included with the distribution.
# SPDX-License-Identifier: MIT
# -------------------------------------------------------------------
HOST="https://host.docker.internal:8000"
echo "wait until OpenSlides is up"
until [[ $(curl -k -s -o /dev/null -w %{http_code} $HOST) -eq 200 ]];
do
sleep 5
done
echo ready
exec npx cypress run

View File

@ -5,7 +5,8 @@
"packages": { "packages": {
"": { "": {
"devDependencies": { "devDependencies": {
"cypress": "8.4.0" "cypress": "8.4.0",
"wait-on": "^6.0.0"
} }
}, },
"node_modules/@cypress/request": { "node_modules/@cypress/request": {
@ -57,6 +58,42 @@
"ms": "^2.1.1" "ms": "^2.1.1"
} }
}, },
"node_modules/@hapi/hoek": {
"version": "9.2.1",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz",
"integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==",
"dev": true
},
"node_modules/@hapi/topo": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
"integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
"dev": true,
"dependencies": {
"@hapi/hoek": "^9.0.0"
}
},
"node_modules/@sideway/address": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.2.tgz",
"integrity": "sha512-idTz8ibqWFrPU8kMirL0CoPH/A29XOzzAzpyN3zQ4kAWnzmNfFmRaoMNN6VI8ske5M73HZyhIaW4OuSFIdM4oA==",
"dev": true,
"dependencies": {
"@hapi/hoek": "^9.0.0"
}
},
"node_modules/@sideway/formula": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
"integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==",
"dev": true
},
"node_modules/@sideway/pinpoint": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
"dev": true
},
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "14.17.12", "version": "14.17.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.12.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.12.tgz",
@ -245,6 +282,15 @@
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
"dev": true "dev": true
}, },
"node_modules/axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.14.0"
}
},
"node_modules/balanced-match": { "node_modules/balanced-match": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -750,6 +796,26 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/follow-redirects": {
"version": "1.14.5",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
"integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/forever-agent": { "node_modules/forever-agent": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@ -1046,6 +1112,19 @@
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"dev": true "dev": true
}, },
"node_modules/joi": {
"version": "17.4.2",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.4.2.tgz",
"integrity": "sha512-Lm56PP+n0+Z2A2rfRvsfWVDXGEWjXxatPopkQ8qQ5mxCEhwHG+Ettgg5o98FFaxilOxozoa14cFhrE/hOzh/Nw==",
"dev": true,
"dependencies": {
"@hapi/hoek": "^9.0.0",
"@hapi/topo": "^5.0.0",
"@sideway/address": "^4.1.0",
"@sideway/formula": "^3.0.0",
"@sideway/pinpoint": "^2.0.0"
}
},
"node_modules/jsbn": { "node_modules/jsbn": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
@ -1761,6 +1840,40 @@
"extsprintf": "^1.2.0" "extsprintf": "^1.2.0"
} }
}, },
"node_modules/wait-on": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz",
"integrity": "sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==",
"dev": true,
"dependencies": {
"axios": "^0.21.1",
"joi": "^17.4.0",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"rxjs": "^7.1.0"
},
"bin": {
"wait-on": "bin/wait-on"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/wait-on/node_modules/rxjs": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.4.0.tgz",
"integrity": "sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w==",
"dev": true,
"dependencies": {
"tslib": "~2.1.0"
}
},
"node_modules/wait-on/node_modules/tslib": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz",
"integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==",
"dev": true
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@ -1859,6 +1972,42 @@
} }
} }
}, },
"@hapi/hoek": {
"version": "9.2.1",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz",
"integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==",
"dev": true
},
"@hapi/topo": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
"integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
"dev": true,
"requires": {
"@hapi/hoek": "^9.0.0"
}
},
"@sideway/address": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.2.tgz",
"integrity": "sha512-idTz8ibqWFrPU8kMirL0CoPH/A29XOzzAzpyN3zQ4kAWnzmNfFmRaoMNN6VI8ske5M73HZyhIaW4OuSFIdM4oA==",
"dev": true,
"requires": {
"@hapi/hoek": "^9.0.0"
}
},
"@sideway/formula": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
"integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==",
"dev": true
},
"@sideway/pinpoint": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
"dev": true
},
"@types/node": { "@types/node": {
"version": "14.17.12", "version": "14.17.12",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.12.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.12.tgz",
@ -1996,6 +2145,15 @@
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==",
"dev": true "dev": true
}, },
"axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dev": true,
"requires": {
"follow-redirects": "^1.14.0"
}
},
"balanced-match": { "balanced-match": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -2397,6 +2555,12 @@
"escape-string-regexp": "^1.0.5" "escape-string-regexp": "^1.0.5"
} }
}, },
"follow-redirects": {
"version": "1.14.5",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
"integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==",
"dev": true
},
"forever-agent": { "forever-agent": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
@ -2616,6 +2780,19 @@
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"dev": true "dev": true
}, },
"joi": {
"version": "17.4.2",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.4.2.tgz",
"integrity": "sha512-Lm56PP+n0+Z2A2rfRvsfWVDXGEWjXxatPopkQ8qQ5mxCEhwHG+Ettgg5o98FFaxilOxozoa14cFhrE/hOzh/Nw==",
"dev": true,
"requires": {
"@hapi/hoek": "^9.0.0",
"@hapi/topo": "^5.0.0",
"@sideway/address": "^4.1.0",
"@sideway/formula": "^3.0.0",
"@sideway/pinpoint": "^2.0.0"
}
},
"jsbn": { "jsbn": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
@ -3160,6 +3337,36 @@
"extsprintf": "^1.2.0" "extsprintf": "^1.2.0"
} }
}, },
"wait-on": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.0.tgz",
"integrity": "sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==",
"dev": true,
"requires": {
"axios": "^0.21.1",
"joi": "^17.4.0",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"rxjs": "^7.1.0"
},
"dependencies": {
"rxjs": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.4.0.tgz",
"integrity": "sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w==",
"dev": true,
"requires": {
"tslib": "~2.1.0"
}
},
"tslib": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz",
"integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==",
"dev": true
}
}
},
"which": { "which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View File

@ -1,9 +1,10 @@
{ {
"scripts": { "scripts": {
"cypress:open": "cypress open", "cypress:open": "cypress open",
"cypress:run": "cypress run" "cypress:run": "wait-on -c resource-config.js && cypress run"
}, },
"devDependencies": { "devDependencies": {
"cypress": "8.4.0" "cypress": "8.4.0",
"wait-on": "^6.0.0"
} }
} }

View File

@ -0,0 +1,5 @@
module.exports = {
strictSSL: false,
followRedirect: true,
resources: ['https://host.docker.internal:8000'],
};

View File

@ -0,0 +1,5 @@
module.exports = {
strictSSL: false,
followRedirect: true,
resources: ['https://localhost:8000'],
};