Skip to content
Snippets Groups Projects
Commit 2ee87760 authored by Aggarwal Himanshu's avatar Aggarwal Himanshu
Browse files

Add initial cypress setup and test

parent 8458f324
No related branches found
No related tags found
2 merge requests!27Merge develop branch into main,!18Setup and initialize testing
......@@ -11,6 +11,7 @@ function Tab({ id, content, activeTab, onClick }) {
}
)}
onClick={() => onClick(id)}
id={id}
>
{content}
</button>
......
{}
/// <reference types="cypress" />
describe("table on home page", () => {
beforeEach(() => {
cy.visit("localhost:3000");
});
it("displays table", () => {
cy.get("button#list-view").should("be.visible");
cy.get("button#list-view").click();
cy.get("table").should("be.visible");
});
});
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
// ***********************************************
// 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 --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
// ***********************************************************
// This example support/index.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'
// Alternatively you can use CommonJS syntax:
// require('./commands')
......@@ -6,7 +6,8 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"docs": "jsdoc -c ./jsdoc.json"
"docs": "jsdoc -c ./jsdoc.json",
"cypress": "cypress open"
},
"dependencies": {
"@heroicons/react": "^1.0.5",
......@@ -29,6 +30,7 @@
"devDependencies": {
"autoprefixer": "^10.4.2",
"better-docs": "2.4.1",
"cypress": "^9.5.2",
"eslint": "8.9.0",
"eslint-config-next": "12.1.0",
"jsdoc": "^3.6.10",
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment