magnificent-finland-58048
04/15/2022, 2:36 PMmagnificent-finland-58048
04/15/2022, 2:39 PMflaky-airport-12178
04/15/2022, 3:28 PMfast-teacher-87788
04/15/2022, 3:54 PMfast-teacher-87788
04/15/2022, 4:07 PMjavascript
cy.fixture("ui_testing.wav", "binary").then((audio) => {
var buffer = Uint8Array.from(audio, c => c.charCodeAt(0));
cy.intercept(
{ method: "GET", hostname: "localhost", path: "/ui_testing.wav" },
{
headers: { "Content-Type": "application/octet-stream" },
body: buffer.buffer,
}
).as("audio_sample")
})
fast-teacher-87788
04/15/2022, 4:08 PMfresh-doctor-14925
04/16/2022, 8:51 AMbeforeEach()
. Meanwhile the app is still chatting away and we get an uncaught exception due to our authentication broker returning a 403
Given that the conventional wisdom is that each scenario exists in its own context, I can see how this causes confusionmagnificent-finland-58048
04/16/2022, 12:46 PMmagnificent-finland-58048
04/16/2022, 12:53 PMnumerous-secretary-63087
04/16/2022, 5:49 PMdontSee()
but I can't figure out how to do this in Cypress. ><fresh-doctor-14925
04/16/2022, 6:09 PM.should()
It’ll be something like
cy.get(“#element”).should(“not.contain”, specificText)
https://docs.cypress.io/api/commands/should
(Though I suggest making assertions on test ids rather than text content, if you can)numerous-secretary-63087
04/16/2022, 6:10 PMfresh-doctor-14925
04/16/2022, 6:16 PM.should(“not.be.visible”)
If that’s chained to your get()
you can then chain another assertion for the text like my example above.
So:
cy.get(“#element”).should(“not.be.visible”).and(“not.contain”, specificText)
aloof-house-17015
04/16/2022, 6:37 PMnumerous-secretary-63087
04/16/2022, 8:43 PMpurple-action-61464
04/17/2022, 1:26 AMgray-kilobyte-89541
04/17/2022, 1:56 PMbright-monitor-4080
04/18/2022, 5:53 PMaloof-house-17015
04/19/2022, 10:21 AMcreamy-coat-62912
04/19/2022, 12:35 PMcurved-intern-4253
04/20/2022, 3:38 PMyarn run cypress open
, yarn cypress open
, and npx cypress open
all result in It looks like this is your first time using Cypress: 9.5.4
Cypress verification failed.
This command failed with the following output:
/home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=564
----------
Platform: linux-x64 (Ubuntu - 20.04)
Cypress Version: 9.5.4
error Command failed with exit code 1.
The weird part is that if I run the command given, its exit code is 0: alexey@DESKTOP-41AVESA:~/shaka/popmenu$ /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=564
alexey@DESKTOP-41AVESA:~/shaka/popmenu$ echo $?
0
Using cypress run
instead of open
makes no difference; cypress info
looks fine to me: $ /home/alexey/shaka/popmenu/node_modules/.bin/cypress info
Proxy Settings: none detected
Environment Variables: none detected
Application Data: /home/alexey/.config/cypress/cy/development
Browser Profiles: /home/alexey/.config/cypress/cy/development/browsers
Binary Caches: /home/alexey/.cache/Cypress
Cypress Version: 9.5.4 (stable)
System Platform: linux (Ubuntu - 20.04)
System Memory: 6.23 GB free 5.7 GB
Done in 0.23s.
What could be the problem?curved-intern-4253
04/20/2022, 3:44 PM--browser /usr/bin/google-chrome
doesn't help.curved-intern-4253
04/20/2022, 6:05 PMDEBUG=cypress:*
, it looked like the problem was incorrect $DISPLAY
. But now I got other GUI apps to run in WSL, cypress still fails: alexey@DESKTOP-41AVESA:~/shaka/popmenu$ DEBUG=cypress:* npx cypress verify
cypress:cli:cli cli starts with arguments ["/home/alexey/.nvm/versions/node/v14.19.1/bin/node","/home/alexey/shaka/popmenu/node_modules/.bin/cypress","verify"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli:cli program parsing arguments +1ms
cypress:cli parsed cli options {} +1ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +0ms
cypress:cli checking if executable exists /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress +2ms
cypress:cli Binary is executable? : true +2ms
cypress:cli binaryDir is /home/alexey/.cache/Cypress/9.5.4/Cypress +1ms
cypress:cli Reading binary package.json from: /home/alexey/.cache/Cypress/9.5.4/Cypress/resources/app/package.json +0ms
cypress:cli Found binary version 9.5.4 installed in: /home/alexey/.cache/Cypress/9.5.4/Cypress +2ms
cypress:cli could not read binary_state.json file at "/home/alexey/.cache/Cypress/9.5.4/binary_state.json" +3ms
cypress:cli {} +0ms
cypress:cli is Verified ? undefined +1ms
cypress:cli force verify +0ms
cypress:cli running binary verification check 9.5.4 +0ms
curved-intern-4253
04/20/2022, 6:05 PMcypress:cli clearing out the verified version +3ms
cypress:cli DISPLAY environment variable is set to 172.17.176.1:0 on Linux
cypress:cli Assuming this DISPLAY points at working X11 server,
cypress:cli Cypress will not spawn own Xvfb
cypress:cli
cypress:cli NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
cypress:cli see https://github.com/cypress-io/cypress/issues/4034
cypress:cli Solution: Unset the DISPLAY variable and try again:
cypress:cli DISPLAY= npx cypress run ... +0ms
cypress:cli needs Xvfb? false +1ms
cypress:cli spawning, should retry on display problem? true +0ms
cypress:cli disabling Electron sandbox +0ms
cypress:cli running smoke test +0ms
cypress:cli using Cypress executable /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress +0ms
cypress:cli smoke test command: /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=217 +0ms
cypress:cli smoke test timeout 30000 ms +0ms
cypress:cli smoke test stdout "" +8ms
cypress:cli Smoke test failed because could not find 217 in: {
command: '/home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=217',
exitCode: 0,
stdout: '',
stderr: '',
all: undefined,
failed: false,
timedOut: false,
isCanceled: false,
killed: false
Cypress verification failed.
This command failed with the following output:
/home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=217
----------
Platform: linux-x64 (Ubuntu - 20.04)
Cypress Version: 9.5.4
user
04/22/2022, 7:49 AMgentle-oxygen-2271
04/22/2022, 8:37 AMgray-kilobyte-89541
04/22/2022, 11:34 AMgentle-oxygen-2271
04/22/2022, 11:40 AMcolossal-car-14055
04/22/2022, 7:10 PMgray-kilobyte-89541
04/23/2022, 12:31 PM