Basis tests for every website testing project.
Add following line in your cypress/support/e2e.js|.ts file
import 'cypress-ncatestify-plugin'
in your cypress.config.js|.ts file the key baseUrl must be set
module.exports = defineConfig({
e2e: {
baseUrl: 'https://testify.team/de',
setupNodeEvents(on, config) {
// implement node event listeners here
}
}
})Then in your Testfile
describe('Validate Testify Tests', () => {
it('Runs Testify base tests', () => {
cy.visit('/')
cy.ttRunTestifyBaseTests()
})
})npm run typechecknpm run buildnpx cypress open --config-file config.cypress.ts/jsexport CYPRESS_BASE_URL=https://nevercodealone.de && npx cypress open --config-file config.cypress.ts/jscd eleventy-page && npx eleventy --serve
npx eleventy
For contributing remove local .js files
rm -rf **/*.jsValidate types with no generating
npm run typecheckBuild js files
npm run builddocker run -p 8090:80 -v $(pwd)/src:/app --entrypoint python3 python:3.9-alpine -m http.server --directory /app 80
To run the test suite, execute the following command:
npx jest --config jest.config.tsThis will run all Jest tests located in the __tests__ directory.
To perform TypeScript type checking, run:
npm run typecheckThis ensures that the code adheres to the TypeScript configurations and catches potential type errors.
To auto-format the codebase, run:
npm run prettierThis will format the code according to the rules specified in the .prettierrc file.
All of these checks are automatically run in our GitHub Actions CI/CD pipeline on every push and pull request to the main branch. This ensures that all merged code is properly tested, type-checked, and formatted.
cy.ttCookieAllAcceptClick()cy.ttEveryInternalLinkStatusOk()cy.ttValidateAllImagesResponseStatusOk()cy.ttEveryInternalLinkIsLoading()cy.ttGetInternalLinks()cy.ttValidateImprintClickable()cy.ttValidateNoGoogleServices()cy.ttRunTestifyBaseTests()cy.ttAccessibility()cy.ttValidatePageContent()cy.ttOnlyOneH1()cy.ttInvalidPath404()cy.ttValidateLanguageTag(language: string)cy.ttDetectHttp()cy.ttNoConsoleErrors()https://www.auto-hortz.de https://www.discounto.de https://nevercodealone.de