e2e test in github

This commit is contained in:
SPRINX0\prochazka
2024-12-06 16:12:51 +01:00
parent ac0ea6a937
commit 22b47d1066
3 changed files with 46 additions and 3 deletions

43
.github/workflows/e2e-tests.yaml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: E2E tests
on:
push:
branches:
- master
- develop
- 'feature/**'
jobs:
test-runner:
runs-on: ubuntu-latest
container: node:18
steps:
- name: Context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: yarn install
run: |
yarn install
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: yarn prepare:packer
start: node packer/build/bundle.js --listen-api
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: npm run build
start: npm start
services:
mysql:
image: mysql:8.0.18
env:
MYSQL_ROOT_PASSWORD: Pwd2020Db
ports:
- 16004:3306

View File

@@ -14,7 +14,7 @@ for (const pkg of volatilePackages) {
if (apiPackageJson.dependencies[pkg]) { if (apiPackageJson.dependencies[pkg]) {
dependencies[pkg] = apiPackageJson.dependencies[pkg]; dependencies[pkg] = apiPackageJson.dependencies[pkg];
} }
if (apiPackageJson.optionalDependencies[pkg]) { if (apiPackageJson.optionalDependencies?.[pkg]) {
optionalDependencies[pkg] = apiPackageJson.optionalDependencies[pkg]; optionalDependencies[pkg] = apiPackageJson.optionalDependencies[pkg];
} }
} }

View File

@@ -1,11 +1,11 @@
describe('Initialization', () => { describe('Initialization', () => {
it('successfully loads', () => { it('successfully loads', () => {
cy.visit('http://localhost:5001'); cy.visit('http://localhost:3000');
cy.contains('Database not selected'); cy.contains('Database not selected');
}); });
it('adds connection', () => { it('adds connection', () => {
cy.visit('http://localhost:5001'); cy.visit('http://localhost:3000');
cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL'); cy.get('[data-testid=ConnectionDriverFields_connectionType]').select('MySQL');
cy.get('[data-testid=ConnectionDriverFields_user]').clear().type('root'); cy.get('[data-testid=ConnectionDriverFields_user]').clear().type('root');
cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('Pwd2020Db'); cy.get('[data-testid=ConnectionDriverFields_password]').clear().type('Pwd2020Db');