Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Cypress 10 #1661

Merged
merged 3 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/docker-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ jobs:
run: |
npm ci && npm run install-server:dev
- name: ✅ Cypress run
uses: cypress-io/github-action@v2
uses: cypress-io/github-action@v3.1.0
with:
install: false
start: npm run start:cypress
wait-on: 'http://localhost:1444'
config-file: ./front/cypress/cypress.json
config-file: ./front/cypress/cypress.config.js
project: ./front
command: npm run cypress:run
build-front:
Expand All @@ -135,7 +135,7 @@ jobs:
working-directory: ./front
run: |
npm run build-with-stats
- name: Upload webpack stats artifact
- name: ↗️ Upload webpack stats artifact
uses: relative-ci/agent-upload-artifact-action@v1
with:
webpackStatsFile: ./front/stats.json
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: 💽 Setup nodejs
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
DOCKERHUB_REPO: ${{secrets.DOCKERHUB_REPO}}
steps:
- name: ⬇️ Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: 🐳 Docker meta
id: docker_meta
uses: docker/metadata-action@v4
Expand Down
69 changes: 69 additions & 0 deletions front/cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const { defineConfig } = require('cypress');

const VARIABLES = {};

module.exports = defineConfig({
// setupNodeEvents can be defined in either
// the e2e or component configuration
e2e: {
setupNodeEvents(on, config) {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
on('task', {
storeVariable: ({ key, value }) => {
VARIABLES[key] = value;
return null;
},
loadVariable: key => {
const value = VARIABLES[key];
return value === undefined ? null : value;
}
});

// Load NODE env variables
const language = process.env.LANGUAGE || 'en';
config.env.language = language;

const serverUrl = process.env.LOCAL_API_URL || 'http://localhost:1443';
config.env.serverUrl = serverUrl;

const websocketUrl = process.env.WEBSOCKET_URL || 'ws://localhost:1443';
config.env.websocketUrl = websocketUrl;

const i18n = require(`../src/config/i18n/${language}.json`);
config.env.i18n = i18n;

return config;
},
video: false,
screenshotOnRunFailure: false,
defaultCommandTimeout: 30000,
pageLoadTimeout: 120000,
baseUrl: 'http://localhost:1444',
env: {
house: {
name: 'My House',
selector: 'my-house',
rooms: [
{
name: 'Living Room',
selector: 'living-room'
}
]
},
users: {
tony: {
firstname: 'Tony',
lastname: 'Stark',
selector: 'tony',
role: 'admin',
email: 'tony.stark@gladysassistant.com',
password: 'ONvAayxwrK',
birthYear: '2011',
birthMonth: '2',
birthDay: '4'
}
}
}
}
});
32 changes: 0 additions & 32 deletions front/cypress/cypress.json

This file was deleted.

48 changes: 0 additions & 48 deletions front/cypress/plugins/index.js

This file was deleted.

File renamed without changes.
Loading