stale-optician-85950
11/03/2022, 2:31 PMstale-optician-85950
11/03/2022, 2:39 PMdefu
to allow inheritance from our main cypress.config.ts
and only need to list the values you are changing i.e. in your case baseUrl
My code example uses it for a mobile config file cypress/configs/cypress.mobile.config.ts
import { defineConfig } from 'cypress';
import defu from 'defu';
import defaultConfig from '../../cypress.config';
export default defineConfig(
defu(
{
viewportWidth: 375,
viewportHeight: 812,
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) Mobile/15E148',
env: {
device: 'mobile',
},
e2e: {
excludeSpecPattern: ['**/e2e/site-monitoring/*', '**/e2e/keyboard-navigation/*'],
},
},
defaultConfig
)
);
The run command uses --config-file
attribute to specify your config file:
yarn cypress run --browser chrome --config-file cypress/configs/cypress.mobile.config.ts
colossal-agent-50119
11/03/2022, 2:46 PMdry-portugal-25841
11/03/2022, 2:51 PMflaky-tailor-940
11/03/2022, 2:59 PMfresh-belgium-26376
11/03/2022, 4:12 PMproud-breakfast-29892
11/03/2022, 4:37 PMcy.intercept
but redirect
doesn't work.brief-accountant-77319
11/03/2022, 5:11 PMcy.clock()
to test the app at a certain time (e.g. 6 am, 6 pm). It works, the date is changing in those tests, but the problem is that I am also using .scrollIntoView()
on some elements and mocked clock breaks it - it's not scrolling and I have to use cy.tick()
to make it work.
It's a bit annoying to put cy.tick()
, especially when I also test some things without mocked clock, then I cannot use cy.tick()
.
Every element in my application that animates is broken and I have to put cy.tick()
. Is there some workaround or am I doing something wrong? Is it possible to set the "initial" date and just let it go?gray-kilobyte-89541
11/03/2022, 5:22 PMproud-breakfast-29892
11/03/2022, 5:24 PMalert-insurance-63399
11/03/2022, 5:50 PMalert-insurance-63399
11/03/2022, 5:53 PMalert-insurance-63399
11/03/2022, 6:01 PMalert-insurance-63399
11/03/2022, 6:18 PMhttps://
in the endpoint, so it was redirecting me to that, but not including the body. added it to the url, and its working fine nowfierce-match-41873
11/03/2022, 9:02 PMstale-optician-85950
11/03/2022, 9:39 PMgreat-london-82425
11/03/2022, 9:44 PMgreat-london-82425
11/03/2022, 10:11 PMgray-kilobyte-89541
11/03/2022, 10:51 PMfancy-mechanic-10638
11/04/2022, 12:14 AM.only
to those three specific tests.gray-kilobyte-89541
11/04/2022, 12:18 AMfancy-mechanic-10638
11/04/2022, 1:01 AM.get('app-some-component input')
but I'm having to do .get('app-some-component').find('input')
instead.fierce-match-41873
11/04/2022, 1:57 AMagreeable-doctor-59104
11/04/2022, 6:22 AMdelightful-engineer-44693
11/04/2022, 7:00 AMhallowed-gold-66187
11/04/2022, 7:42 AMstale-optician-85950
11/04/2022, 8:35 AMambitious-monkey-72386
11/04/2022, 10:00 AMambitious-monkey-72386
11/04/2022, 10:01 AMambitious-monkey-72386
11/04/2022, 10:01 AM