Skip to content

Commit

Permalink
chore(deps): upgrade cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel A. White committed Dec 13, 2023
1 parent a0ed4ef commit 5649e1b
Show file tree
Hide file tree
Showing 8 changed files with 666 additions and 275 deletions.
253 changes: 161 additions & 92 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'cypress';

export default defineConfig({
reporter: 'junit',
reporterOptions: {
mochaFile: 'cypress/results/output.xml',
toConsole: false,
},
screenshotsFolder: 'cypress/results/screenshots',
videosFolder: 'cypress/results/videos',
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:4200/',
},
});
11 changes: 0 additions & 11 deletions cypress.json

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ describe('Stoplight component', () => {
it('loads api page correctly', () => {
loadStoplightProjectPage();

cy.intercept(`https://stoplight.io/api/v1/projects/cHJqOjYwNjYx/nodes/**`).as('getNode');
cy.intercept(`https://stoplight.io/api/v1/projects/cHJqOjYwNjYx/nodes/*`, { middleware: true }, req => {
req.on('before:response', res => {
// force all API responses to not be cached
res.headers['cache-control'] = 'no-store';
});
}).as('getNode');
cy.findByText('To-dos').click();
cy.wait('@getNode');

Expand Down Expand Up @@ -110,7 +115,12 @@ describe('Stoplight component', () => {
});

function loadStoplightProjectPage() {
cy.intercept('https://stoplight.io/api/v1/projects/cHJqOjYwNjYx/nodes/**').as('getNode');
cy.intercept('https://stoplight.io/api/v1/projects/cHJqOjYwNjYx/nodes/*', { middleware: true }, req => {
req.on('before:response', res => {
// force all API responses to not be cached
res.headers['cache-control'] = 'no-store';
});
}).as('getNode');
cy.visit('/stoplight-project');
cy.wait('@getNode');
}
Expand All @@ -132,7 +142,13 @@ function loadMarkdownPage() {
}

function visitNode(nodeId: string, nodeSlug: string) {
cy.intercept(`https://stoplight.io/api/v1/projects/cHJqOjYwNjYx/nodes/${nodeId}`).as('getNode');
cy.log(nodeId);
cy.intercept(`https://stoplight.io/api/v1/projects/cHJqOjYwNjYx/nodes/${nodeId}*`, { middleware: true }, req => {
req.on('before:response', res => {
// force all API responses to not be cached
res.headers['cache-control'] = 'no-store';
});
}).as('getNode');
cy.visit(`/stoplight-project/${nodeId}-${nodeSlug}`);
cy.wait('@getNode');
}
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"@storybook/react": "7.6.4",
"@storybook/react-webpack5": "7.6.4",
"@storybook/theming": "7.6.4",
"@testing-library/cypress": "^7.0.3",
"@testing-library/cypress": "^10.0.1",
"@typescript-eslint/eslint-plugin": "4.28.4",
"@typescript-eslint/parser": "4.28.4",
"concurrently": "6.1.0",
"css-loader": "6.7.1",
"cssnano": "5.0.6",
"cypress": "^6.3.0",
"cypress": "^13.6.1",
"eslint": "7.31.0",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-jest": "24.4.0",
Expand Down
Loading

0 comments on commit 5649e1b

Please sign in to comment.