bitter-lock-96362
04/28/2023, 5:19 PM.wait()
. After those tests pass, my UI seems to get stuck in what looks like an in between state. My intuition tells me that this is an issue stemming from the asynchronous .wait()
. However, I do have loading skeletons and a spinner that renders while waiting for data, perhaps that is the issue?
The question: Is there a way I can get my UI to update with the stubbed data that I'm missing? I've been digging trough the docs and chatGPT, and It just seems like I have things tied up the way I should. Thanks in advance for any help!
Repo: https://github.com/cameronRomo/GameStack/tree/feature/filter-games
First screenshot shows the problem, second shows app working without stub.
https://cdn.discordapp.com/attachments/1101558392935424072/1101558393354858646/Screen_Shot_2023-04-28_at_11.11.21_AM.png▾
https://cdn.discordapp.com/attachments/1101558392935424072/1101558393677815920/Screen_Shot_2023-04-28_at_11.14.20_AM.png▾
incalculable-rainbow-43330
04/28/2023, 5:21 PMechoing-tent-95037
04/28/2023, 7:14 PMfuture-salesmen-48792
04/28/2023, 7:21 PMhttps://cdn.discordapp.com/attachments/1101589129671749744/1101589130212806726/Screenshot_2023-04-28_at_2.50.09_PM.png▾
powerful-toothbrush-36495
04/29/2023, 11:17 AMstraight-laptop-29696
04/30/2023, 4:38 AMstrong-cat-47196
04/30/2023, 9:21 AMquiet-house-97222
05/01/2023, 8:49 AMhttps://cdn.discordapp.com/attachments/1102517145885229097/1102517146036219965/image.png▾
https://cdn.discordapp.com/attachments/1102517145885229097/1102517146296262676/image.png▾
https://cdn.discordapp.com/attachments/1102517145885229097/1102517146568900668/image.png▾
https://cdn.discordapp.com/attachments/1102517145885229097/1102517146875080764/image.png▾
fast-artist-45202
05/01/2023, 5:47 PMCypress.Commands.add("popup", () => {
const popup = Cypress.$(state.popup.document);
return cy.wrap(popup.contents().find("body"));
});
and when I run the tests as described in the above tutorial, I'm getting the following:
Cannot read properties of undefined (reading 'document')
Has anyone had more success implementing coverage for PayPal checkout options? Is there a better method I could use?cold-bird-96191
05/01/2023, 6:41 PMjolly-window-21891
05/01/2023, 8:11 PMaloof-psychiatrist-45078
05/02/2023, 4:07 AMRUN npx cypress install && npx cypress run
In the logs below, the terminal seems not waiting for the cypress to finish install, and tries to run cypress directly causing error
11:58:28 STEP 13/14: RUN npx cypress install && npx cypress run
11:58:28 Installing Cypress (version: 12.11.0)
11:58:28
11:58:28 [STARTED] Task without title.
11:58:28
11:58:28 > consulting-one-ui@ cy:run /opt/app-root/src
11:58:28 > cypress run
11:58:28
11:58:28 No version of Cypress is installed in: /root/.cache/Cypress/12.11.0/Cypress
11:58:28
11:58:28 Please reinstall Cypress by running: cypress install
11:58:28
11:58:28 ----------
11:58:28
11:58:28 Cypress executable not found at: /root/.cache/Cypress/12.11.0/Cypress/Cypress
11:58:28
11:58:28 ----------
quiet-dream-68129
05/02/2023, 5:59 AMworried-hairdresser-56712
05/02/2023, 6:01 AMcy.get("strong + .btn-close").should("be.visible").click().then(function() {
let text = moment().format("YYYY-MM-DD hh:mm");
return text
});
cy.contains(text).should("be.visible");
The result is:
text is not defined
What did I do wrong here? Thank you.worried-hairdresser-56712
05/02/2023, 7:19 AMcy.intercept("GET", "/client/coverage-request-batch/*").as(
"closingBatchDetailsPage"
);
cy.intercept("POST", "/client/coverage-request-batch/*/discardfile").as(
"deleteUploadedFile"
);
But, when the responses is there, Cypress detects the first one, even though the response is 'POST'.
Am I doing something wrong? Thank you beforehand.quiet-room-72008
05/02/2023, 2:37 PMpurple-afternoon-2408
05/03/2023, 12:27 AMclever-night-39043
05/03/2023, 6:34 AMTypeError: Cannot read properties of null (reading 'classList')
The button is like this
<button _ngcontent-dxy-c108="" id="CopyBtn" type="button" aria-label="Copy URL" data-bs-toggle="dropdown">Copy Link</button>
I am not sure what is wrong with it. Can anyone please help?
Thanks
https://cdn.discordapp.com/attachments/1103208026636304434/1103208026929897482/image.png▾
white-appointment-55436
05/03/2023, 8:36 AMbillowy-petabyte-65450
05/03/2023, 2:14 PMfuture-journalist-95278
05/04/2023, 12:16 AMYour browser is not currently supported. Please use a recommended browser or learn more here.
.
The code I am running is here:
ts
Cypress.Commands.add('logIntoTwitch', () => {
logIntoTwitch(Cypress.env('TWITCH_USER'), Cypress.env('TWITCH_PW'))
})
function logIntoTwitch(username: string, password: string) {
cy.visit('http://localhost:3000/api/auth/signin?callbackUrl=%2Fdashboard')
cy.get('button').click()
cy.origin(
'https://www.twitch.tv/login',
{
args: {
username,
password,
},
},
({ username, password }) => {
cy.get('input[id="login-username"]').type(username)
cy.get('input[id="password-input"]').type(password, {
log: false,
})
cy.get('button[data-a-target="passport-login-button"]').click()
}
)
}
Visually, it works just fine. Clicking the correct input fields, typing, and submitting the expected data. The issue is Twitch is saying the browser spawned within the E2E test isn't supported. Is there something I may be able to do to make this work?
https://cdn.discordapp.com/attachments/1103475121118785659/1103475121680810017/FvPjTvaaIAEwocS.jpeg▾
quiet-room-72008
05/04/2023, 7:43 AMpurple-afternoon-2408
05/04/2023, 7:52 AMgray-fall-5541
05/04/2023, 8:21 AMerror:- The following error originated from your test code, not from Cypress.
> Cannot access 'WEBPACK_DEFAULT_EXPORT' before initialization
When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.
Cypress could not associate this error to any specific test.
We dynamically generated a new test to display this failure.
.
what can be the possible solution for this error (I researched about this error but did not find any clue) ?purple-afternoon-2408
05/04/2023, 8:46 AMechoing-kangaroo-83836
05/04/2023, 1:26 PMuseEffect()
and then does a window.open()
passing _blank
as it's second argument like window.open(url, "_blank")
which causes it to open in a new tab. While running inside Cypress I want to change this to _self
so I can test the URL was properly navigated to. At the top of the useEffect()
I'm setting a variable for this using const openLocation = window.Cypress ? '_self' : '_blank';
and then passing openLocation
to the window.open()
call.
The problem I'm running into is openLocation
is always _blank
even though when I'm running cypress I can go to the console and do window.Cypress
and see there is a Cypress object defined there. Is this some sort of race condition?few-ability-10425
05/04/2023, 1:30 PMmagnificent-animal-85146
05/04/2023, 1:32 PMfaint-ocean-92094
05/04/2023, 5:17 PMvar count = 100
for(var i = 0; i < count: i++) {
cy.visit("https://mypage.com")
}
Now at some point between 95 and 100 (because it depends on other tests that could visit this page more than once) the test will crash saying the page responded with a 405 and did not respond with 20x code. That all makes sense and it is the correct behavior.
My question is, what would be the correct way to stop the loop (or complete it, doesn't matter) when I get this response and just continue till the end so I land on the captcha page. I just need to verify the captcha appeared so it is pretty straight forward. I just can't make the failOnStatusCode: false
because it is not a request block. Any recommendations?ebrainy-army-77830
05/04/2023, 6:15 PM