Fixed running Cypress tests on Firefox (#33768)

Closes #32617

Signed-off-by: Agnieszka Gancarczyk <agagancarczyk@gmail.com>
This commit is contained in:
Agnieszka Gancarczyk 2024-10-10 11:10:54 +01:00 committed by GitHub
parent 988af11a39
commit 00728bebb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,6 +24,17 @@ export default defineConfig({
slowTestThreshold: 30000, slowTestThreshold: 30000,
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}", specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
on("before:browser:launch", (browser, launchOptions) => {
if (browser.family === "firefox") {
// launchOptions.preferences is a map of preference names to values
// login is not working in firefox when testing_localhost_is_secure_when_hijacked is false
launchOptions.preferences[
"network.proxy.testing_localhost_is_secure_when_hijacked"
] = true;
}
return launchOptions;
});
// after:spec collides with cypressSplit function below and is overridden there // after:spec collides with cypressSplit function below and is overridden there
function afterSpecRemoveSuccessfulVideos(spec, results) { function afterSpecRemoveSuccessfulVideos(spec, results) {