Only run css selector identifier tests to run on desktop
This commit is contained in:
parent
14e4ca9c28
commit
014cc756bc
@ -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.
|
If you change one of these identifiers, you must update the documentation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import filterTests from '../../support/filterTests';
|
||||||
|
|
||||||
const identifiers = [
|
const identifiers = [
|
||||||
'header', // The entire header component
|
'header', // The entire header component
|
||||||
'footer', // The entire footer component
|
'footer', // The entire footer component
|
||||||
@ -16,7 +18,8 @@ const identifiers = [
|
|||||||
'#follow-button', // The follow button
|
'#follow-button', // The follow button
|
||||||
];
|
];
|
||||||
|
|
||||||
describe(`Has correct identifiers for overrides`, () => {
|
filterTests(['desktop'], () => {
|
||||||
|
describe(`Has correct identifiers for overrides`, () => {
|
||||||
it('Can visit the page', () => {
|
it('Can visit the page', () => {
|
||||||
cy.visit('http://localhost:8080/');
|
cy.visit('http://localhost:8080/');
|
||||||
});
|
});
|
||||||
@ -41,4 +44,5 @@ describe(`Has correct identifiers for overrides`, () => {
|
|||||||
cy.contains('Notify').click();
|
cy.contains('Notify').click();
|
||||||
cy.get(modalContainer, { timeout: 2000 }).should('be.visible');
|
cy.get(modalContainer, { timeout: 2000 }).should('be.visible');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -6,11 +6,14 @@ These should be documented so people know how to customize their pages.
|
|||||||
If you change one of these identifiers, you must update the documentation.
|
If you change one of these identifiers, you must update the documentation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import filterTests from '../../support/filterTests';
|
||||||
|
|
||||||
const identifiers = [
|
const identifiers = [
|
||||||
'#chat-container', // The entire chat container component
|
'#chat-container', // The entire chat container component
|
||||||
];
|
];
|
||||||
|
|
||||||
describe(`Has correct identifiers for overrides`, () => {
|
filterTests(['desktop'], () => {
|
||||||
|
describe(`Has correct identifiers for overrides`, () => {
|
||||||
it('Can visit the page', () => {
|
it('Can visit the page', () => {
|
||||||
cy.visit('http://localhost:8080/');
|
cy.visit('http://localhost:8080/');
|
||||||
});
|
});
|
||||||
@ -21,4 +24,5 @@ describe(`Has correct identifiers for overrides`, () => {
|
|||||||
cy.get(identifier).should('be.visible');
|
cy.get(identifier).should('be.visible');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
24
test/automated/browser/cypress/support/filterTests.js
Normal file
24
test/automated/browser/cypress/support/filterTests.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/// <reference types="Cypress" />
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter Cypress tests based on a given tag or tags. If no tags are present, run tests.
|
||||||
|
*
|
||||||
|
* @param {[string]} definedTags An array of tags
|
||||||
|
* @param {Function} runTest All tests captured within a Cypress run
|
||||||
|
* @example npm run open --env tags=api
|
||||||
|
* @example npm run open --env tags=api/ui
|
||||||
|
*/
|
||||||
|
const filterTests = (definedTags, runTest) => {
|
||||||
|
if (Cypress.env('tags')) {
|
||||||
|
const tags = Cypress.env('tags').split('/');
|
||||||
|
const found = definedTags.some(($definedTag) => tags.includes($definedTag));
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
runTest();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// runTest();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default filterTests;
|
@ -42,7 +42,7 @@ SERVER_PID=$!
|
|||||||
pushd test/automated/browser
|
pushd test/automated/browser
|
||||||
|
|
||||||
# Run cypress browser tests for desktop
|
# Run cypress browser tests for desktop
|
||||||
npx cypress run --group "desktop-offline" --ci-build-id $BUILD_ID --tag "desktop,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js"
|
npx cypress run --group "desktop-offline" --env tags=desktop --ci-build-id $BUILD_ID --tag "desktop,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js"
|
||||||
# Run cypress browser tests for mobile
|
# Run cypress browser tests for mobile
|
||||||
npx cypress run --group "mobile-offline" --ci-build-id $BUILD_ID --tag "mobile,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js" --config viewportWidth=375,viewportHeight=667
|
npx cypress run --group "mobile-offline" --ci-build-id $BUILD_ID --tag "mobile,offline" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/offline/*.cy.js" --config viewportWidth=375,viewportHeight=667
|
||||||
|
|
||||||
@ -62,6 +62,6 @@ trap finish EXIT SIGHUP SIGINT SIGTERM SIGQUIT SIGABRT SIGTERM
|
|||||||
sleep 20
|
sleep 20
|
||||||
|
|
||||||
# Run cypress browser tests for desktop
|
# Run cypress browser tests for desktop
|
||||||
npx cypress run --group "desktop-online" --ci-build-id $BUILD_ID --tag "desktop,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js"
|
npx cypress run --group "desktop-online" --env tags=desktop --ci-build-id $BUILD_ID --tag "desktop,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js"
|
||||||
# Run cypress browser tests for mobile
|
# Run cypress browser tests for mobile
|
||||||
npx cypress run --group "mobile-online" --ci-build-id $BUILD_ID --tag "mobile,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js" --config viewportWidth=375,viewportHeight=667
|
npx cypress run --group "mobile-online" --ci-build-id $BUILD_ID --tag "mobile,online" --record --key e9c8b547-7a8f-452d-8c53-fd7531491e3b --spec "cypress/e2e/online/*.cy.js" --config viewportWidth=375,viewportHeight=667
|
||||||
|
Loading…
x
Reference in New Issue
Block a user