flat-dentist-98143
10/06/2022, 2:12 PMaloof-laptop-78265
10/06/2022, 3:24 PMmicroscopic-advantage-2187
10/06/2022, 4:11 PMfreezing-wall-7568
10/06/2022, 4:53 PMuser
10/06/2022, 5:30 PMfreezing-piano-2792
10/06/2022, 5:50 PMstepDefinitions
look like?freezing-piano-2792
10/06/2022, 5:51 PMfresh-nail-30646
10/06/2022, 6:03 PM10.9.0
but now I'm getting a permission error when trying to run cypress open
. The permission error is on ~/Library/Caches/Cypress/10.9.0/binary_state.json
. Anybody run into this and have a solution?freezing-piano-2792
10/06/2022, 6:18 PMfreezing-piano-2792
10/06/2022, 6:19 PMfreezing-wall-7568
10/06/2022, 6:20 PMfreezing-piano-2792
10/06/2022, 6:23 PMmysterious-kitchen-59722
10/06/2022, 7:13 PMprehistoric-horse-97860
10/06/2022, 7:29 PMflaky-raincoat-53097
10/06/2022, 8:49 PMflaky-raincoat-53097
10/06/2022, 8:50 PMflaky-raincoat-53097
10/06/2022, 8:51 PMflaky-raincoat-53097
10/06/2022, 8:52 PMflaky-raincoat-53097
10/06/2022, 8:52 PMgifted-umbrella-24016
10/06/2022, 9:07 PMmatchMedia
in a cypress component test. I have tried doing the following in a beforeEach, but it doesn't work:
cy.stub(window, 'matchMedia').withArgs('(prefers-reduced-motion: reduce)').returns({
matches: true,
})
Does anyone have any ideas on how I can fix this? Really need the ability to test this functionality in our component testsstale-optician-85950
10/06/2022, 9:16 PMcy.request
example:
describe('Social Links', () => {
it('Validates Facebook link', () => {
cy.visit('https://www.businessinsider.com/ikea-nyc-store-planning-studio-tour-2019-4');
cy.get('[aria-label="Share This Post"] [aria-label="Click to visit us on Facebook"]')
.first()
.invoke('attr', 'data-href')
.then($el => {
cy.log('$el', $el);
cy.request($el).then(resp => {
expect(resp.status).to.eq(200);
});
});
});
});
Remember that you are not testing 3rd party websites, you are only concerned about your client website.
Also it's not necessary to post the same question in multiple channels.flaky-raincoat-53097
10/06/2022, 9:58 PMflaky-raincoat-53097
10/06/2022, 9:58 PMflaky-raincoat-53097
10/06/2022, 9:58 PMbored-school-78265
10/07/2022, 12:31 AMexport function percyResponsiveSnapshot(name?: string | string[], options?: SnapshotOptions) {
const names = nameToNames(name)
getWidths(options).forEach((width) => {
cy.window().then((window) => {
const originalWidth = window.visualViewport.width
const height = window.visualViewport.height
debugger
cy.viewport(width, height)
percyNamedSnapshot([...names, width.toFixed()], {...options, widths: [width]})
cy.viewport(originalWidth, height)
})
})
}
but the problem is that when run in the GUI, the visualViewport
is the size of the iframe excluding the padding. Calling cy.viewport
seems to remove the 15px of padding. So first time around originalWidth
is 985px, second time around it is 970px, third 955px and so on.bored-school-78265
10/07/2022, 12:43 AMwindow.innerWidth
instead.shy-winter-53144
10/07/2022, 3:16 AMabundant-lifeguard-9043
10/07/2022, 8:36 AMnarrow-minister-71622
10/07/2022, 8:54 AMstale-optician-85950
10/07/2022, 9:01 AM