Skip to content

Commit

Permalink
reorganized cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Dec 16, 2022
1 parent d4c3004 commit cd3a6cb
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {navsLoop, stylesCal} from "../../support/test-helper";
import {navsLoop, stylesCal} from "../support/test-helper";

describe("Test all calendar navs for all styles", () => {
navsLoop(stylesCal);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {snapId, goCheckNext, goCheckPrev, styles} from "../../support/test-helper";
import {snapId, goCheckNext, goCheckPrev, styles} from "../support/test-helper";

describe("Test all comboNavs for all styles", () => {
const id = "#combo-nav-js";
const id = "#combo-nav-js";
const id_input = `${id} input`;

for (const style of styles) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {snapId} from "../../support/test-helper";
import {snapId} from "../support/test-helper";

describe("Test generic helpers", () => {
const pages = [1, 5, 36, 50];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
describe("Test behavior of input based helpers", () => {

const invalids = ["1000", "abcdef"];
const pages = ["1", "5"];
const pages = ["1", "5"];

for (const invalid of invalids) {
it("Test input in #items-selector-js", () => {
cy.visit(`/navs?page=1`)
.get("#items-selector-js input").type(`${invalid}{enter}`)
.should(($input) => {
expect($input.val()).not.to.eq(invalid);
expect($input.val()).to.eq("20");
}).location().should(loc => expect(loc.href).to.match(new RegExp(`page=1`)));
expect($input.val()).not.to.eq(invalid);
expect($input.val()).to.eq("20");
}).location().should(loc => expect(loc.href).to.match(new RegExp(`page=1`)));
});

for (const page of pages) {
Expand All @@ -19,9 +19,9 @@ describe("Test behavior of input based helpers", () => {
cy.visit(`/navs?page=${page}`)
.get("#combo-nav-js input").type(`${invalid}{enter}`)
.should(($input) => {
expect($input.val()).not.to.eq(invalid);
expect($input.val()).to.eq(page);
}).location().should(loc => expect(loc.href).to.match(new RegExp(`page=${page}`)));
expect($input.val()).not.to.eq(invalid);
expect($input.val()).to.eq(page);
}).location().should(loc => expect(loc.href).to.match(new RegExp(`page=${page}`)));
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {navsLoop, styles} from "../../support/test-helper";
import {navsLoop, styles} from "../support/test-helper";

describe("Test all navs for all styles", () => {
navsLoop(styles);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {styles, stylesCal, navIds} from "../../support/test-helper";
import {styles, stylesCal, navIds} from "../support/test-helper";

describe("Test trim in all helpers and styles", () => {
const testLoop = (styles:string[], ids:string[], param:string) => {
Expand Down
7 changes: 4 additions & 3 deletions e2e/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// ***********************************************************
// This example support/index.js is processed and
// This example support/e2e.ts 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
// You can change the location of this file or turn off (false)
// automatically serving support files with the
// 'supportFile' configuration option.
//
Expand All @@ -18,5 +18,6 @@ import * as cypressSnapshots from "@cypress/snapshot";
// @ts-expect-error: register does not exist
cypressSnapshots.register();
afterEach(() => cy.htmlvalidate());
// Silence issue https://github.com/quasarframework/quasar/issues/2233
// Silence issue https://github.com/quasarframework/quasar/issues/2233#issuecomment-1006506083
// Cypress issue (open) https://github.com/cypress-io/cypress/issues/20341
Cypress.on("uncaught:exception", err => !err.message.includes("ResizeObserver"));

0 comments on commit cd3a6cb

Please sign in to comment.