adventurous-dream-20049
03/08/2022, 2:34 PMadventurous-dream-20049
03/08/2022, 3:30 PMadventurous-dream-20049
03/08/2022, 3:31 PMenough-plastic-87422
03/08/2022, 4:19 PMloud-honey-66910
03/09/2022, 1:35 AMadventurous-dream-20049
03/09/2022, 4:12 AMcold-doctor-52849
03/09/2022, 5:44 PMuser
03/10/2022, 1:04 PMcy.visit("/nyköping")
with baseUrl
set to https://climatevisualizer.com
I get a 500.
But the url https://climatevisualizer.com/nyköping works fine.
It seems to be related to encoding, since routes without åäö
works fine such as cy.visit("/skara")
. And it also works if I use cy.visit("/" + encodeURIComponent("nyköping"))
This problem only occurs when using Cypress.
Any clues?user
03/10/2022, 1:24 PMthankful-controller-3208
03/11/2022, 9:11 AMpowerful-orange-86819
03/14/2022, 2:28 PMjs
cy.intercept(
{
method: "GET",
pathname: env.path,
query: {
dateFrom: "2020-12-31T22:00:00.000Z",
dateTo: "2022-01-01T21:59:59.000Z",
},
},
(req) => {
expect(req.url).to.include(
"&dateFrom=2020-12-31T22%3A00%3A00.000Z",
"Date From included"
);
expect(req.url).to.include(
"&dateTo=2022-01-01T21%3A59%3A59.000Z",
"Date to included"
);
}
).as("filterByDates");
Executing it on my local environment is fine, but when I run it in the pipeline there is a problem, because server time is UTC by default, the test always fails, because sent time is not as expected.
Now I'm thinking how to approach this, because the time input is not by me, but by the plugin "datePicker", which always inputs the machine time (server/environment), so the question is what is a good approach towards this issue? (i'm using day.js)
Do I convert each time input to UTC ?
Do I intercept the request and make it UTC -2 for the request ?
Or should I just ignore everything after "T" including hours/minutes/seconds, which I'm highly against.
I'll really be glad if i get responses, thanks in advance.damp-country-52800
03/14/2022, 6:31 PMvar genArr = Array.from({ length: 5 }, (v, k) => k)
cy.wrap(genArr).each((index) => {
cy.get('#reportsNavExportButtonV2').should('be.visible').click().as('exportButton')
cy.get('div.export-button-container')
.find('button')
.eq(index)
.as('modalButton')
.then(($index) => {
if ($index === 1) {
cy.get('#pdfCustomTrack').click()
} else {
cy.get('@modalButton').click()
}
})
})
})
how can I change this test to make it work ?
Thank you very muchdazzling-angle-28206
03/15/2022, 10:56 AMcool-microphone-40049
03/15/2022, 3:16 PM@cypress/react
library and I expect my component to throw error. How can I test that the proper error has been thrown, and prevent the test from failing?powerful-orange-86819
03/15/2022, 3:51 PMcool-microphone-40049
03/15/2022, 3:58 PMmount(<Component/>
should throw an error.glamorous-monkey-67605
03/16/2022, 6:10 PMglamorous-monkey-67605
03/16/2022, 6:11 PMadorable-smartphone-87280
03/17/2022, 5:00 PMdamp-country-52800
03/17/2022, 7:09 PMhigh-market-48478
03/18/2022, 11:24 AMred-ghost-44720
03/20/2022, 11:17 AMbrief-kite-35331
03/21/2022, 10:13 AMbrief-kite-35331
03/21/2022, 10:13 AMfancy-match-96032
03/22/2022, 2:17 PMdamp-country-52800
03/22/2022, 6:18 PMpowerful-orange-86819
03/23/2022, 9:08 AMwooden-exabyte-51274
03/24/2022, 10:55 AMAssertionError: Timed out retrying after 4000ms: Expected to find content: 'Log In' but never did.
eager-magician-32906
03/24/2022, 4:54 PMuser
03/25/2022, 1:05 AMdescribe('cy.request options', () => {
it('test', () => {
cy.request({
method: 'GET',
url: 'https://swapi.dev/api/people/9999999999',
retryOnStatusCodeFailure: true,
retryOnNetworkFailure: true,
failOnStatusCode: true
})
})
})