Skip to content

Commit

Permalink
remove firefox from our ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ob6160 committed Sep 24, 2024
1 parent 8826a54 commit 42baf28
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 161 deletions.
76 changes: 0 additions & 76 deletions .github/workflows/cypress-e2e-firefox.yml

This file was deleted.

10 changes: 0 additions & 10 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ export default defineConfig({
config = cypressBrowserPermissionsPlugin(on, config);

on('before:browser:launch', (browser, launchOptions) => {
if (browser.family === 'firefox') {
// launchOptions.preferences is a map of preference names to values
// eslint-disable-next-line functional/immutable-data
launchOptions.preferences[
'network.proxy.testing_localhost_is_secure_when_hijacked'
] = true;

return launchOptions;
}

if (browser.name === 'chrome' && browser.isHeadless) {
const headlessIndex = launchOptions.args.indexOf('--headless');
if (headlessIndex > -1) {
Expand Down
19 changes: 5 additions & 14 deletions cypress/e2e/desktop/index.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('Home page tests', () => {
cy.stub(win.navigator.geolocation, 'getCurrentPosition').callsFake(
(callback) => {
return callback({ coords: { latitude, longitude, accuracy } });
}
},
);
});
cy.visit('/').wait(500);
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('Home page tests', () => {
cy.stub(win.navigator.geolocation, 'getCurrentPosition').callsFake(
(callback) => {
return callback({ coords: { latitude, longitude, accuracy } });
}
},
);
});
cy.visit('/').wait(500);
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('Home page tests', () => {
cy.stub(win.navigator.geolocation, 'getCurrentPosition').callsFake(
(callback) => {
return callback({ coords: { latitude, longitude, accuracy } });
}
},
);
});
cy.visit('/').wait(500);
Expand All @@ -193,11 +193,6 @@ describe('Home page tests', () => {
});

it('should update the accessibility overlay list when the user pans or zooms', () => {
// Disable in Firefox as the `type` command is not being recognised for some reason
if (Cypress.isBrowser('firefox')) {
return;
}

cy.visit('/').wait(500);
cy.get('[data-toiletid=ddad1ed1b91d99ed2bf3bcdf]').should('exist');
cy.get('#gbptm-map').focus().wait(500);
Expand Down Expand Up @@ -230,10 +225,6 @@ describe('Home page tests', () => {
});

it('should select a toilet using the number key associated with the accessibility overlay list', () => {
// Disable in Firefox as the `type` command is not being recognised for some reason
if (Cypress.isBrowser('firefox')) {
return;
}
cy.visit('/').wait(500);
cy.get('[data-toiletid=ddad1ed1b91d99ed2bf3bcdf]').should('exist');
// Focus the map, turning on the accessibility overlay
Expand All @@ -258,7 +249,7 @@ describe('Home page tests', () => {
cy.get('#highlighted-loo').invoke('attr', 'data-toiletid', '2671');
// Check that the accessibility view is hidden
cy.contains("Use number keys to show a toilet's details").should(
'not.exist'
'not.exist',
);
cy.contains('Arrow keys pan the map').should('not.exist');
cy.contains('change the map zoom level').should('not.exist');
Expand Down Expand Up @@ -576,7 +567,7 @@ describe('Home page tests', () => {
cy.get('[data-toiletid=ab2ebfbdadb963aed4cb3b65]').click({ force: true });
cy.intercept('POST', '/api', (req) => {
expect(req.body.operationName).to.equal(
'submitVerificationReportMutation'
'submitVerificationReportMutation',
);
});
cy.findByText('Yes').click();
Expand Down
37 changes: 12 additions & 25 deletions cypress/e2e/mobile/edit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Edit page tests', () => {
cy.contains('Align the crosshair');
cy.findByDisplayValue('outrageous webmail');
cy.findByText('happy-go-lucky toilet!! hence dead jingle!').should(
'exist'
'exist',
);
cy.findByDisplayValue('£7.99 on entry');

Expand Down Expand Up @@ -68,7 +68,7 @@ describe('Edit page tests', () => {
];

const inputChoices = refs.map(
(ref, i) => `${ref[0]}:${inputStates[indexPicks[i]]}`
(ref, i) => `${ref[0]}:${inputStates[indexPicks[i]]}`,
);

const detailChecks = refs.map((ref, i) => [
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('Edit page tests', () => {
cy.get('[name=friday-closes]').clear().type('23:00');

cy.findByPlaceholderText(
'Add any other useful information about the toilet here'
'Add any other useful information about the toilet here',
)
.clear()
.type('I ran out of loo roll! Otherwise good.');
Expand Down Expand Up @@ -153,28 +153,15 @@ describe('Edit page tests', () => {
it('should update the location of the toilet to where the map is dragged', () => {
cy.visit('loos/ca6249ebcd1490e2aaccc5be/edit').wait(500);

// touchstart, touchmove etc are not supported in Firefox
if (Cypress.isBrowser('firefox')) {
cy.get('#gbptm-map')
.trigger('mousedown', { which: 1, force: true })
.trigger('mousemove', 1000, -1800, { which: 1, force: true })
.trigger('mouseup', { force: true })
.wait(100)
.trigger('mousedown', { which: 1, force: true })
.trigger('mousemove', -1500, 1100, { which: 1, force: true })
.trigger('mouseup', { force: true })
.wait(500);
} else {
cy.get('#gbptm-map')
.trigger('touchstart', { which: 1, force: true })
.trigger('touchmove', 1000, -1800, { which: 1, force: true })
.trigger('touchend', { force: true })
.wait(100)
.trigger('touchstart', { which: 1, force: true })
.trigger('touchmove', -1500, 1100, { which: 1, force: true })
.trigger('touchend', { force: true })
.wait(500);
}
cy.get('#gbptm-map')
.trigger('touchstart', { which: 1, force: true })
.trigger('touchmove', 1000, -1800, { which: 1, force: true })
.trigger('touchend', { force: true })
.wait(100)
.trigger('touchstart', { which: 1, force: true })
.trigger('touchmove', -1500, 1100, { which: 1, force: true })
.trigger('touchend', { force: true })
.wait(500);

cy.findByText('Update the toilet').click();

Expand Down
49 changes: 13 additions & 36 deletions cypress/e2e/mobile/index.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,15 @@ describe('Home page tests', () => {
cy.get('[data-toiletid=ddad1ed1b91d99ed2bf3bcdf]').should('exist');
cy.get('[data-toiletid=cc4e5e9b83de8dd9ba87b3eb]').should('not.exist');

// touchstart, touchmove etc are not supported in Firefox
if (Cypress.isBrowser('firefox')) {
cy.get('#gbptm-map')
.trigger('mousedown', { which: 1 })
.trigger('mousemove', 1000, -1800, { which: 1, force: true })
.trigger('mouseup')
.wait(100)
.trigger('mousedown', { which: 1 })
.trigger('mousemove', -600, 1100, { which: 1, force: true })
.trigger('mouseup')
.wait(500);
} else {
cy.get('#gbptm-map')
.trigger('touchstart', { which: 1 })
.trigger('touchmove', 1000, -1800, { which: 1, force: true })
.trigger('touchend')
.wait(100)
.trigger('touchstart', { which: 1 })
.trigger('touchmove', -600, 1100, { which: 1, force: true })
.trigger('touchend')
.wait(500);
}
cy.get('#gbptm-map')
.trigger('touchstart', { which: 1 })
.trigger('touchmove', 1000, -1800, { which: 1, force: true })
.trigger('touchend')
.wait(100)
.trigger('touchstart', { which: 1 })
.trigger('touchmove', -600, 1100, { which: 1, force: true })
.trigger('touchend')
.wait(500);

cy.get('[data-toiletid=ddad1ed1b91d99ed2bf3bcdf]').should('not.exist');
cy.get('[data-toiletid=cc4e5e9b83de8dd9ba87b3eb]').should('exist');
Expand All @@ -109,7 +96,7 @@ describe('Home page tests', () => {
cy.stub(win.navigator.geolocation, 'getCurrentPosition').callsFake(
(callback) => {
return callback({ coords: { latitude, longitude, accuracy } });
}
},
);
});
cy.visit('/').wait(500);
Expand Down Expand Up @@ -144,7 +131,7 @@ describe('Home page tests', () => {
cy.stub(win.navigator.geolocation, 'getCurrentPosition').callsFake(
(callback) => {
return callback({ coords: { latitude, longitude, accuracy } });
}
},
);
});
cy.visit('/').wait(500);
Expand All @@ -165,11 +152,6 @@ describe('Home page tests', () => {
});

it('should update the accessibility overlay list when the user pans or zooms', () => {
// Disable in Firefox as the `type` command is not being recognised for some reason
if (Cypress.isBrowser('firefox')) {
return;
}

cy.visit('/').wait(500);
cy.get('[data-toiletid=ddad1ed1b91d99ed2bf3bcdf]').should('exist');
cy.get('#gbptm-map').focus().wait(200);
Expand All @@ -193,11 +175,6 @@ describe('Home page tests', () => {
});

it('should select a toilet using the number key associated with the accessibility overlay list', () => {
// Disable in Firefox as the `type` command is not being recognised for some reason
if (Cypress.isBrowser('firefox')) {
return;
}

cy.visit('/').wait(500);
cy.get('[data-toiletid=ddad1ed1b91d99ed2bf3bcdf]').should('exist');
// Focus the map, turning on the accessibility overlay
Expand Down Expand Up @@ -226,7 +203,7 @@ describe('Home page tests', () => {
cy.get('#highlighted-loo').invoke('attr', 'data-toiletid', '2671');
// Check that the accessibility view is hidden
cy.contains("Use number keys to show a toilet's details").should(
'not.exist'
'not.exist',
);
cy.contains('Arrow keys pan the map').should('not.exist');
cy.contains('change the map zoom level').should('not.exist');
Expand Down Expand Up @@ -441,7 +418,7 @@ describe('Home page tests', () => {
cy.get('[data-toiletid=ab2ebfbdadb963aed4cb3b65]').click({ force: true });
cy.intercept('POST', '/api', (req) => {
expect(req.body.operationName).to.equal(
'submitVerificationReportMutation'
'submitVerificationReportMutation',
);
});
cy.findByText('Yes').click();
Expand Down

0 comments on commit 42baf28

Please sign in to comment.