Skip to content
Open
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
37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021
},
"plugins": ["cypress", "@typescript-eslint", "prettier"],
"extends": [
"prettier",
"plugin:prettier/recommended",
"plugin:jsonc/recommended-with-jsonc",
"eslint:recommended",
"plugin:cypress/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"files": ["*.json", "*.json5", "*.jsonc"],
"parser": "jsonc-eslint-parser"
}
],
"rules": {
"@typescript-eslint/no-namespace": "off",
"cypress/no-assigning-return-values": "error",
"cypress/no-unnecessary-waiting": "error",
"cypress/assertion-before-screenshot": "warn",
"cypress/no-force": "warn",
"cypress/no-async-tests": "error",
"prettier/prettier": 2,
"indent": ["error", 2]
},
"env": {
"cypress/globals": true,
"node": true
}
}
25 changes: 25 additions & 0 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Cypress Tests

on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cypress run
uses: cypress-io/github-action@v3
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos
78 changes: 78 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,81 @@ Tests/Acceptance/Support/_generated/
front/*
!front/recommended.json
!front/kill_node_server.sh

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

cypress/videos
cypress/screenshots
node_modules
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 120
}
11 changes: 11 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
baseUrl: 'https://testify.team'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be set to ddev domain, right?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @LennardTestify please check the Readme file in root folder for the info.

},
viewportWidth: 1200,
retries: {
runMode: 3
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this 2 lines

viewportWidth: 1200,
experimentalMemoryManagement: true

Viewport default setting will make mors stability for different test systems and momory management should have power ;)

});
13 changes: 13 additions & 0 deletions cypress/e2e/accessibility.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {StartPage} from "@/pages/StartPage"

describe('Accessibility tests.', () => {
const startPage: StartPage = new StartPage();

beforeEach(() => {
startPage.visit();
});

it('A11y tests', () => {
cy.ttAccessibility();
});
})
14 changes: 14 additions & 0 deletions cypress/e2e/error.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {StartPage} from "@/pages/StartPage"

describe('Error pages.', () => {
const startPage:StartPage = new StartPage();

beforeEach(() => {
startPage.visit();
startPage.waitForPageLoaded();
});

it('404 status for invalid URL path', () => {
cy.ttInvalidPath404();
})
});
14 changes: 14 additions & 0 deletions cypress/e2e/google-services.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {StartPage} from "@/pages/StartPage"

describe('Google services.', () => {
const startPage:StartPage = new StartPage();

beforeEach(() => {
startPage.visit();
startPage.waitForPageLoaded();
});

it('No routes are loaded.', () => {
cy.ttValidateNoGoogleServices();
})
});
15 changes: 15 additions & 0 deletions cypress/e2e/image-response.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {StartPage} from "@/pages/StartPage"

describe('Image validation.', () => {
const startPage: StartPage = new StartPage();

beforeEach(() => {
startPage.visit();
startPage.waitForPageLoaded();
});

it('All images have response status 200', () => {
cy.ttValidateAllImagesResponseStatusOk();
});

})
14 changes: 14 additions & 0 deletions cypress/e2e/imprint.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {StartPage} from "@/pages/StartPage"

describe('Imprint.', () => {
const startPage:StartPage = new StartPage();

beforeEach(() => {
startPage.visit();
startPage.waitForPageLoaded();
});

it('Is clickable on inital start', () => {
cy.ttValidateImprintClickable();
});
})
18 changes: 18 additions & 0 deletions cypress/e2e/internal-links.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {StartPage} from "@/pages/StartPage"

describe('Validate links.', () => {
const startPage:StartPage = new StartPage();

beforeEach(() => {
startPage.visit();
startPage.waitForPageLoaded();
});

it('All internal links 200', () => {
cy.ttEveryInternalLinkStatusOk();
});

it('All interla links are loading', () => {
cy.ttEveryInternalLinkIsLoading();
})
})
17 changes: 17 additions & 0 deletions cypress/e2e/testify-tests.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/// <reference types="Cypress" />
describe('TESTIFY base tests', () => {
beforeEach(() => {
cy.visit('/');
});

it('Imprint link on starpage is clickable', () => {
cy.ttValidateAllImagesResponseStatusOk();
cy.ttEveryInternalLinkStatusOk();
cy.ttValidateNoGoogleServices();
cy.ttValidateImprintClickable();
cy.ttValidatePageContent();
cy.ttInvalidPath404();
cy.ttAccessibility();
});

});
Empty file added cypress/fixtures/.gitkeep
Empty file.
10 changes: 10 additions & 0 deletions cypress/pages/BasePage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export abstract class BasePage {
visit() {
cy.visit('/');
}

waitForPageLoaded() {
cy.wait(2000);
}

}
3 changes: 3 additions & 0 deletions cypress/pages/StartPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { BasePage } from '@/pages/BasePage';

export class StartPage extends BasePage {}
26 changes: 26 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --

import 'cypress-axe'
31 changes: 31 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';

import 'cypress-ncatestify-plugin';

// Alternatively you can use CommonJS syntax:
// require('./commands')

Cypress.on('uncaught:exception', (err, promise) => {
if (err.message.includes('o.removeEventListener')) {
return false;
}
if (promise) {
return false;
}
});
1 change: 1 addition & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare namespace Cypress {}
Loading