feat(e2e): Add cypress globals to eslint overrides (#43234)
fix(docs): Remove cypress eslint note on e2e docs
This commit is contained in:
committed by
GitHub
parent
b3cae635e1
commit
e2d6639773
@ -59,6 +59,13 @@
|
|||||||
{
|
{
|
||||||
"files": ["./tools/ui-components/**/*.test.[jt]s?(x)", "./client/**/*.test.[jt]s?(x)"],
|
"files": ["./tools/ui-components/**/*.test.[jt]s?(x)", "./client/**/*.test.[jt]s?(x)"],
|
||||||
"extends": ["plugin:testing-library/react", "plugin:jest-dom/recommended"]
|
"extends": ["plugin:testing-library/react", "plugin:jest-dom/recommended"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["cypress/**/*.js"],
|
||||||
|
"globals": {
|
||||||
|
"cy": true,
|
||||||
|
"Cypress": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
const certificationUrl = '/certification/developmentuser/responsive-web-design';
|
const certificationUrl = '/certification/developmentuser/responsive-web-design';
|
||||||
const projects = {
|
const projects = {
|
||||||
superBlock: 'responsive-web-design',
|
superBlock: 'responsive-web-design',
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
heading: "[data-test-label='landing-header']",
|
heading: "[data-test-label='landing-header']",
|
||||||
callToAction: "[data-test-label='landing-big-cta']",
|
callToAction: "[data-test-label='landing-big-cta']",
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const locations = {
|
const locations = {
|
||||||
index:
|
index:
|
||||||
'learn/back-end-development-and-apis/managing-packages-with-npm/' +
|
'learn/back-end-development-and-apis/managing-packages-with-npm/' +
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
defaultOutput: '.output-text',
|
defaultOutput: '.output-text',
|
||||||
editor: '.react-monaco-editor-container'
|
editor: '.react-monaco-editor-container'
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
defaultOutput: '.output-text',
|
defaultOutput: '.output-text',
|
||||||
editor: '.monaco-editor',
|
editor: '.monaco-editor',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const projects = {
|
const projects = {
|
||||||
superBlock: 'machine-learning-with-python',
|
superBlock: 'machine-learning-with-python',
|
||||||
block: 'machine-learning-with-python-projects',
|
block: 'machine-learning-with-python-projects',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Certification intro page', () => {
|
describe('Certification intro page', () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.clearCookies();
|
cy.clearCookies();
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
footer: '.site-footer'
|
footer: '.site-footer'
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Help Button', () => {
|
describe('Help Button', () => {
|
||||||
it('should be visible', () => {
|
it('should be visible', () => {
|
||||||
cy.visit(
|
cy.visit(
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
heading: "[data-test-label='landing-header']",
|
heading: "[data-test-label='landing-header']",
|
||||||
smallCallToAction: "[data-test-label='landing-small-cta']",
|
smallCallToAction: "[data-test-label='landing-small-cta']",
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const search = query => {
|
const search = query => {
|
||||||
cy.get('.ais-SearchBox').within(() => {
|
cy.get('.ais-SearchBox').within(() => {
|
||||||
cy.get('input').type(query);
|
cy.get('input').type(query);
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
donateSupport: {
|
donateSupport: {
|
||||||
firstTitle: '.donate-support h4:first-of-type b',
|
firstTitle: '.donate-support h4:first-of-type b',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
donateAlert: {
|
donateAlert: {
|
||||||
firstText: '.alert-info p:first-child',
|
firstText: '.alert-info p:first-child',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Donate page', () => {
|
describe('Donate page', () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.clearCookies();
|
cy.clearCookies();
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Navigation links', () => {
|
describe('Navigation links', () => {
|
||||||
it('should render the expected forum and news links.', () => {
|
it('should render the expected forum and news links.', () => {
|
||||||
cy.visit('/learn');
|
cy.visit('/learn');
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
challengeMap: "[data-test-label='learn-curriculum-map']"
|
challengeMap: "[data-test-label='learn-curriculum-map']"
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const challengeUrl =
|
const challengeUrl =
|
||||||
'/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements';
|
'/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements';
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
tableOfContents: '.intro-toc',
|
tableOfContents: '.intro-toc',
|
||||||
warningMessage: '.flash-message-enter-active'
|
warningMessage: '.flash-message-enter-active'
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const projects = {
|
const projects = {
|
||||||
superBlock: 'responsive-web-design',
|
superBlock: 'responsive-web-design',
|
||||||
block: 'responsive-web-design-projects',
|
block: 'responsive-web-design-projects',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
firstBlock: '.block-ui > .block:nth-child(1) > .map-title'
|
firstBlock: '.block-ui > .block:nth-child(1) > .map-title'
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Legacy redirects', () => {
|
describe('Legacy redirects', () => {
|
||||||
it('should redirect from front-end-libraries to front-end-development-libraries', () => {
|
it('should redirect from front-end-libraries to front-end-development-libraries', () => {
|
||||||
cy.visit('learn/front-end-libraries');
|
cy.visit('learn/front-end-libraries');
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
const locations = {
|
const locations = {
|
||||||
chalSuper: '/challenges/responsive-web-design/',
|
chalSuper: '/challenges/responsive-web-design/',
|
||||||
chalBlock: '/challenges/responsive-web-design/basic-html-and-html5',
|
chalBlock: '/challenges/responsive-web-design/basic-html-and-html5',
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
import '@testing-library/cypress/add-commands';
|
import '@testing-library/cypress/add-commands';
|
||||||
|
|
||||||
describe('Settings certifications area', () => {
|
describe('Settings certifications area', () => {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
describe('Email input field', () => {
|
describe('Email input field', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.exec('npm run seed');
|
cy.exec('npm run seed');
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Picture input field', () => {
|
describe('Picture input field', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login();
|
cy.login();
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Settings', () => {
|
describe('Settings', () => {
|
||||||
it('should be possible to reset your progress', () => {
|
it('should be possible to reset your progress', () => {
|
||||||
cy.login();
|
cy.login();
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Username input field', () => {
|
describe('Username input field', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login();
|
cy.login();
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
describe('The Document Metadata', () => {
|
describe('The Document Metadata', () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Top contributor in user profile', () => {
|
describe('Top contributor in user profile', () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.clearCookies();
|
cy.clearCookies();
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/* global cy */
|
|
||||||
|
|
||||||
describe('Report User', () => {
|
describe('Report User', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.exec('npm run seed');
|
cy.exec('npm run seed');
|
||||||
@ -21,5 +19,3 @@ describe('Report User', () => {
|
|||||||
cy.contains('A report was sent to the team with foo@bar.com in copy');
|
cy.contains('A report was sent to the team with foo@bar.com in copy');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// A report was sent to the team with foo@bar.com in copy
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* global cy Cypress*/
|
|
||||||
// ***********************************************
|
// ***********************************************
|
||||||
// This example commands.js shows you how to
|
// This example commands.js shows you how to
|
||||||
// create various custom commands and overwrite
|
// create various custom commands and overwrite
|
||||||
|
@ -4,8 +4,6 @@ When making changes to JavaScript, CSS, or HTML which could change the functiona
|
|||||||
|
|
||||||
To learn how to write Cypress tests, or 'specs', please see Cypress' official [documentation](https://docs.cypress.io/guides/getting-started/writing-your-first-test.html).
|
To learn how to write Cypress tests, or 'specs', please see Cypress' official [documentation](https://docs.cypress.io/guides/getting-started/writing-your-first-test.html).
|
||||||
|
|
||||||
> Note: When writing tests for freeCodeCamp, remember to add `/* global cy */` to the top of the file to avoid ESLint issues.
|
|
||||||
|
|
||||||
## Where to add a test
|
## Where to add a test
|
||||||
|
|
||||||
- Cypress tests are in the `./cypress` directory.
|
- Cypress tests are in the `./cypress` directory.
|
||||||
|
Reference in New Issue
Block a user