NCA TESTIFY commands and tests
npm install cypress-ncatestify-pluginReady-to-use tests for any website. No testing experience required.
This plugin gives you pre-built tests that check if your website works correctly:
- Are all links working?
- Do all images load?
- Is the site accessible?
- Is the SEO structure correct?
You don't need to write complex test code - just call our simple commands.
``bash`
npm install cypress-ncatestify-plugin --save-dev
Add this line to cypress/support/e2e.ts (or .js):
`ts`
import 'cypress-ncatestify-plugin'
In cypress.config.ts:
`ts
import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
baseUrl: 'https://your-website.com'
}
})
`
Create cypress/e2e/my-first-test.cy.ts:
`ts
describe('My Website Tests', () => {
beforeEach(() => {
cy.visit('/')
})
it('all links work', () => {
cy.ttEveryInternalLinkStatusOk()
})
it('all images load', () => {
cy.ttValidateAllImagesResponseStatusOk()
})
it('site is accessible', () => {
cy.ttAccessibility()
})
})
`
`bash`
npx cypress open
That's it! You now have professional website tests.
---
Cypress logs show CSS selectors which are hard to understand:
``
cy.get('#ext-comp-1234') // What element is this?
cy.get('.btn-primary') // Which button?
Use cy.ttEl(selector, name) for readable logs:
`ts`
cy.ttEl('#ext-comp-1234', 'usernameInput') // Logs: usernameInput
cy.ttEl('.btn-primary', 'submitButton') // Logs: submitButton
Now your test logs show meaningful names instead of selectors.
---
For larger projects, use the Page Object Model pattern with BasePage.
The getter name automatically becomes the log name:
`ts
// cypress/pages/LoginPage.ts
import { BasePage } from 'cypress-ncatestify-plugin'
export class LoginPage extends BasePage {
get usernameInput() {
return this.el('#username') // Logs: usernameInput
}
get passwordInput() {
return this.el('#password') // Logs: passwordInput
}
get submitButton() {
return this.el('button[type="submit"]') // Logs: submitButton
}
login(user: string, pass: string) {
this.usernameInput.type(user)
this.passwordInput.type(pass)
this.submitButton.click()
}
}
`
Use in tests:
`ts
import { LoginPage } from '../pages/LoginPage'
const loginPage = new LoginPage()
describe('Login', () => {
it('logs in successfully', () => {
cy.visit('/login')
loginPage.login('admin', 'secret')
})
})
`
---
`ts`
// Select element with semantic logging
cy.ttEl('#username', 'usernameInput') // Logs: usernameInput
cy.ttEl('h1') // Logs: h1
`ts
// Check all internal links return 200 status
cy.ttEveryInternalLinkStatusOk()
// Visit each internal link to verify it loads
cy.ttEveryInternalLinkIsLoading() // Default: 10 links
cy.ttEveryInternalLinkIsLoading(20) // Check 20 links
// Get all internal links as array
cy.ttGetInternalLinks()
cy.ttGetInternalLinks('.content') // From specific container
`
`ts`
// Check all images load successfully
cy.ttValidateAllImagesResponseStatusOk()
`ts`
// Run accessibility tests (uses axe-core)
cy.ttAccessibility()
cy.ttAccessibility('.main-content') // Test specific area
`ts
// Verify only one H1 tag exists
cy.ttOnlyOneH1()
// Check language tag
cy.ttValidateLanguageTag('de') // German
cy.ttValidateLanguageTag('en') // English
// Check imprint/legal link exists
cy.ttValidateImprintClickable()
`
`ts
// Find any non-HTTPS links
cy.ttDetectHttp()
// Check no Google services loaded
cy.ttValidateNoGoogleServices()
`
`ts
// Verify 404 pages work correctly
cy.ttInvalidPath404()
// Monitor console errors
cy.ttSetupConsoleErrorListener()
`
`ts`
// Accept cookies (supports various providers)
cy.ttCookieAllAcceptClick()
`ts
// Check page size threshold (MB)
cy.ttThreshold() // Default threshold
cy.ttThreshold(2) // 2MB limit
// Verify page loaded completely
cy.ttPageLoaded()
`
`ts
// Click element only if it exists
cy.ttClickIfElementExist('.cookie-banner')
// Check if element exists (returns boolean)
cy.ttElementExists('.modal').then(exists => {
if (exists) {
// do something
}
})
`
`ts`
// Execute complete test suite
cy.ttRunTestifyBaseTests()
---
For password-protected staging sites:
`ts`
// cypress.config.ts
export default defineConfig({
e2e: {
baseUrl: 'https://user:password@staging.example.com'
}
})
Or via environment variable:
`bash`
export CYPRESS_BASE_URL=https://user:password@staging.example.com
npx cypress run
---
Add baseUrl to your cypress.config.ts:
`ts`
export default defineConfig({
e2e: {
baseUrl: 'https://your-site.com'
}
})
Increase the timeout in your config:
`ts`
export default defineConfig({
e2e: {
baseUrl: 'https://your-site.com',
defaultCommandTimeout: 10000 // 10 seconds
}
})
Some links like mailto:, tel:, javascript: are automatically skipped. External links are also filtered out.
---
`bash`
npm test # Unit tests
npm run cy:run # Cypress tests
npm run typecheck # Type checking
npm run lint # ESLint
`bash`
npm run build
`bash``
cd eleventy-page && npx @11ty/eleventy --serveOpen http://localhost:8080
---
- Cypress 14.x / 15.x
- TypeScript 5.x
- Node.js 18+
- https://www.auto-hortz.de
- https://www.discounto.de
- https://nevercodealone.de
---
Made with care by NCA TESTIFY