revert: (test, e2e) test suit for cypress (#42488)
This reverts commit 22b45761a7
.
This commit is contained in:
committed by
GitHub
parent
3fc6877bb0
commit
3130265991
@ -0,0 +1,81 @@
|
||||
/* global cy */
|
||||
|
||||
const selectors = {
|
||||
tableOfContents: '.intro-toc',
|
||||
warningMessage: '.flash-message-enter-active'
|
||||
};
|
||||
|
||||
const locations = {
|
||||
index: '/learn/responsive-web-design/basic-css/'
|
||||
};
|
||||
|
||||
const lessonNames = [
|
||||
'Change the Color of Text',
|
||||
'Use CSS Selectors to Style Elements',
|
||||
'Use a CSS Class to Style an Element',
|
||||
'Style Multiple Elements with a CSS Class',
|
||||
'Change the Font Size of an Element',
|
||||
'Set the Font Family of an Element',
|
||||
'Import a Google Font',
|
||||
'Specify How Fonts Should Degrade',
|
||||
'Size Your Images',
|
||||
'Add Borders Around Your Elements',
|
||||
'Add Rounded Corners with border-radius',
|
||||
'Make Circular Images with a border-radius',
|
||||
'Give a Background Color to a div Element',
|
||||
'Set the id of an Element',
|
||||
'Use an id Attribute to Style an Element',
|
||||
'Adjust the Padding of an Element',
|
||||
'Adjust the Margin of an Element',
|
||||
'Add a Negative Margin to an Element',
|
||||
'Add Different Padding to Each Side of an Element',
|
||||
'Add Different Margins to Each Side of an Element',
|
||||
'Use Clockwise Notation to Specify the Padding of an Element',
|
||||
'Use Clockwise Notation to Specify the Margin of an Element',
|
||||
'Use Attribute Selectors to Style Elements',
|
||||
'Understand Absolute versus Relative Units',
|
||||
'Style the HTML Body Element',
|
||||
'Inherit Styles from the Body Element',
|
||||
'Prioritize One Style Over Another',
|
||||
'Override Styles in Subsequent CSS',
|
||||
'Override Class Declarations by Styling ID Attributes',
|
||||
'Override Class Declarations with Inline Styles',
|
||||
'Override All Other Styles by using Important',
|
||||
'Use Hex Code for Specific Colors',
|
||||
'Use Hex Code to Mix Colors',
|
||||
'Use Abbreviated Hex Code',
|
||||
'Use RGB values to Color Elements',
|
||||
'Use RGB to Mix Colors',
|
||||
'Use CSS Variables to change several elements at once',
|
||||
'Create a custom CSS Variable',
|
||||
'Use a custom CSS Variable',
|
||||
'Attach a Fallback value to a CSS Variable',
|
||||
'Improve Compatibility with Browser Fallbacks',
|
||||
'Inherit CSS Variables',
|
||||
'Change a variable for a specific area',
|
||||
'Use a media query to change a variable'
|
||||
];
|
||||
|
||||
const warningMessage =
|
||||
'Note: Some browser extensions may interfere with elements on the page. ' +
|
||||
'If the tests fail, try disabling your extensions for the most reliable ' +
|
||||
'experience.';
|
||||
|
||||
describe('Basic Css Introduction page', function () {
|
||||
it('renders', () => {
|
||||
cy.visit(locations.index);
|
||||
|
||||
cy.title().should('eq', 'Basic CSS | freeCodeCamp.org');
|
||||
});
|
||||
|
||||
it('renders a warning user about extensions', () => {
|
||||
cy.visit(locations.index);
|
||||
cy.get(selectors.warningMessage).contains(warningMessage);
|
||||
});
|
||||
|
||||
it('renders a lesson index', () => {
|
||||
lessonNames.forEach(name => {
|
||||
cy.get(selectors.tableOfContents).contains('span', name);
|
||||
});
|
||||
});
|
||||
});
|
@ -0,0 +1,41 @@
|
||||
/* global cy */
|
||||
|
||||
const selectors = {
|
||||
firstBlock: '.block-ui > .block:nth-child(1) > .map-title'
|
||||
};
|
||||
|
||||
describe('Certification intro page', () => {
|
||||
before(() => {
|
||||
cy.clearCookies();
|
||||
cy.login();
|
||||
cy.visit('/learn/responsive-web-design');
|
||||
});
|
||||
|
||||
it('Should render', () => {
|
||||
cy.title().should(
|
||||
'eq',
|
||||
'Responsive Web Design Certification | freeCodeCamp.org'
|
||||
);
|
||||
});
|
||||
|
||||
it('Should have certification intro text', () => {
|
||||
cy.contains(
|
||||
"In this Responsive Web Design Certification, you'll learn the languages that developers use to build webpages"
|
||||
).should('be.visible');
|
||||
});
|
||||
|
||||
it('First block should be expanded', () => {
|
||||
cy.contains('Say Hello to HTML Elements').should('be.visible');
|
||||
});
|
||||
|
||||
it('Second block should be closed', () => {
|
||||
cy.contains('Change the Color of Text').should('not.exist');
|
||||
});
|
||||
|
||||
it('Block should handle toggle clicks correctly', () => {
|
||||
cy.get(selectors.firstBlock).click();
|
||||
cy.contains('Say Hello to HTML Elements').should('not.exist');
|
||||
cy.get(selectors.firstBlock).click();
|
||||
cy.contains('Say Hello to HTML Elements').should('be.visible');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user