Only run css selector identifier tests to run on desktop

This commit is contained in:
Gabe Kangas
2022-12-12 00:22:31 -08:00
parent 14e4ca9c28
commit 014cc756bc
4 changed files with 64 additions and 32 deletions

View File

@@ -6,6 +6,8 @@ These should be documented so people know how to customize their pages.
If you change one of these identifiers, you must update the documentation.
*/
import filterTests from '../../support/filterTests';
const identifiers = [
'header', // The entire header component
'footer', // The entire footer component
@@ -16,29 +18,31 @@ const identifiers = [
'#follow-button', // The follow button
];
describe(`Has correct identifiers for overrides`, () => {
it('Can visit the page', () => {
cy.visit('http://localhost:8080/');
});
filterTests(['desktop'], () => {
describe(`Has correct identifiers for overrides`, () => {
it('Can visit the page', () => {
cy.visit('http://localhost:8080/');
});
// Loop over each identifier and verify it exists.
identifiers.forEach((identifier) => {
it(`Has identifier: ${identifier}`, () => {
cy.get(identifier).should('be.visible');
// Loop over each identifier and verify it exists.
identifiers.forEach((identifier) => {
it(`Has identifier: ${identifier}`, () => {
cy.get(identifier).should('be.visible');
});
});
// Followers
const followersCollection = '#followers-collection';
it(`Has identifier: ${followersCollection}`, () => {
cy.contains('Followers').click();
cy.get(followersCollection).should('be.visible');
});
// Modal
const modalContainer = '#modal-container';
it(`Has identifier ${modalContainer}`, () => {
cy.contains('Notify').click();
cy.get(modalContainer, { timeout: 2000 }).should('be.visible');
});
});
// Followers
const followersCollection = '#followers-collection';
it(`Has identifier: ${followersCollection}`, () => {
cy.contains('Followers').click();
cy.get(followersCollection).should('be.visible');
});
// Modal
const modalContainer = '#modal-container';
it(`Has identifier ${modalContainer}`, () => {
cy.contains('Notify').click();
cy.get(modalContainer, { timeout: 2000 }).should('be.visible');
});
});

View File

@@ -6,19 +6,23 @@ These should be documented so people know how to customize their pages.
If you change one of these identifiers, you must update the documentation.
*/
import filterTests from '../../support/filterTests';
const identifiers = [
'#chat-container', // The entire chat container component
];
describe(`Has correct identifiers for overrides`, () => {
it('Can visit the page', () => {
cy.visit('http://localhost:8080/');
});
filterTests(['desktop'], () => {
describe(`Has correct identifiers for overrides`, () => {
it('Can visit the page', () => {
cy.visit('http://localhost:8080/');
});
// Loop over each identifier and verify it exists.
identifiers.forEach((identifier) => {
it(`Has identifier: ${identifier}`, () => {
cy.get(identifier).should('be.visible');
// Loop over each identifier and verify it exists.
identifiers.forEach((identifier) => {
it(`Has identifier: ${identifier}`, () => {
cy.get(identifier).should('be.visible');
});
});
});
});