abundant-alarm-34669
02/15/2023, 12:30 PMhelpful-midnight-94669
02/15/2023, 4:07 PMclean-daybreak-15051
02/15/2023, 4:15 PMnpm uninstall --save-dev cypress
but seems like it doesn't work 🧐 Any advice how to uninstall cypress fully or give him permissions.lively-lawyer-22558
02/15/2023, 6:40 PMfamous-energy-17408
02/15/2023, 8:10 PMclever-night-39043
02/16/2023, 6:58 AMTarget cannot be null or undefined
.
In cypress log, it shows something like:
get table#groupsGrid_content_table
assert expected <table#groupsGrid_content_table.e-table> to be visible
"Timed out retrying after 4000ms: Target cannot be null or undefined."
The get
step passed but should
part failed. How can I fix it?
Thanks,incalculable-rainbow-43330
02/16/2023, 7:44 AMflaky-iron-16108
02/16/2023, 12:39 PMabundant-alarm-34669
02/16/2023, 1:22 PMimportant-horse-22426
02/16/2023, 5:58 PMwitty-zebra-42624
02/16/2023, 6:52 PM'@cypress/webpack-preprocessor';
Cypress fails with a compilation error.
Currently I have:
ts
import { defineConfig } from 'cypress';
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
import * as wp from '@cypress/webpack-preprocessor';
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
const webpackOptions = {
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts/,
include: /node_modules/,
loader: 'babel-loader',
options: {
presets: [
['@babel/typescript'],
['@babel/preset-env', { targets: 'defaults' }],
],
// presets: ['@babel/typescript', '@babel/preset-env']
},
},
],
},
};
on('file:preprocessor', wp({ webpackOptions }));
return config;
},
...nxE2EPreset(__dirname),
},
});
It throws this error:
Error: Webpack Compilation Error
Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> import './commands';
| import { configure } from '@testing-library/cypress';
Even just using webpackOptions: undefined
it breaks the entire configuration.
All the docs says that it provides the default configuration, but it seems that something else provides more options.
Any idea how to setup this?
Thanks!cold-author-79999
02/16/2023, 7:05 PMtable tr td:nth-child(5):contains(${tenant})
)
.parents("tr")
.filter((k, tr) => {
return tr.children[0].innerText === house;
})
.filter((k, tr) => {
return tr.children[1].innerText === plot;
})
.find("[data-test-id='options-wrapper']")
.click();
return cy
.get("#my-requests-table tbody tr")
.filter(:has(td:nth-child(3):contains(${p3}))
)
.filter(:has(td:nth-child(4):contains(${p4}))
)
.filter(:has(td:nth-child(2):contains(${p2}))
)
.filter(:has(td:nth-child(1):contains(${p1}))
)
.filter(:has(td:nth-child(5):contains(${p5}))
);
Can you explain the use of filters in each of these scenario?which is the right usage of filter?steep-country-21216
02/16/2023, 8:45 PMaloof-dusk-92239
02/17/2023, 7:38 AMshell
WebSocket connection to 'ws://localhost:PORT/__socket/?EIO=4&transport=websocket' failed
Does anyone know how to solve this problem?dazzling-midnight-17560
02/17/2023, 8:13 AMlittle-byte-59792
02/17/2023, 9:35 AMkind-lock-48901
02/17/2023, 11:06 AM.contains()
command on Cypress v12.6.0
with the following requirements:
- search within the parent selector if the command has prevSubject
, e.g. cy.get(selector).contains(content)
- if the command doesn’t have prevSubject
-> use default selector.
How can I check if .contains()
has a prevSubject and get its value?
Thanks in advance!elegant-ghost-26278
02/17/2023, 12:15 PMloud-dinner-94998
02/17/2023, 2:43 PMbefore()
hook that does the following:
before(() => {
cy.restoreLocalStorage();
cy.loginAndRedirect();
cy.saveLocalStorage();
This is `loginAndRedirect()`:
Cypress.Commands.add('loginAndRedirect', () => {
Cypress.log({ name: 'log in with Auth0' })
const authVariables = getAuth0Variables();
const username = authVariables.username;
const password = authVariables.password;
const audience = authVariables.audience;
const scope = 'openid profile email'
const client_id = authVariables.client_id;
const client_secret = authVariables.client_secret;
return cy.request({
method: 'POST',
url: `${authVariables.url.replace(/\/+$/, "")}/oauth/token`,
body: {
grant_type: 'password',
username,
password,
audience,
scope,
client_id,
client_secret,
},
}).then(({ body: { access_token, expires_in, id_token } }) => {
localStorage.setItem('access_token', access_token);
localStorage.setItem(`@@auth0spajs@@::${client_id}::${audience}::${scope}`, JSON.stringify({
body: {
client_id,
access_token,
id_token,
scope,
expires_in,
decodedToken: {
user: jwt_decode(id_token),
},
},
expiresAt: Math.floor(Date.now() / 1000) + expires_in,
}))
return cy.visit('/?cypress');
});
});
steep-country-21216
02/17/2023, 7:17 PMlimited-yacht-64327
02/18/2023, 3:24 AM> client@0.0.0 test
> cypress run --browser chrome --e2e
Can't run because you've entered an invalid browser name.
Browser: chrome was not found on your system or is not supported by Cypress.
Cypress supports the following browsers:
- electron
- chrome
- chromium
- chrome:canary
- edge
- firefox
You can also use a custom browser: https://on.cypress.io/customize-browsers
Available browsers found on your system are:
- electron
Can't run because you've entered an invalid browser name.
Browser: chrome was not found on your system or is not supported by Cypress.
Cypress supports the following browsers:
- electron
- chrome
- chromium
- chrome:canary
- edge
- firefox
You can also use a custom browser: https://on.cypress.io/customize-browsers
Available browsers found on your system are:
- electron
this is weird because i have chrome installed and it is up to date, cypress is also up to datefresh-shampoo-23978
02/18/2023, 7:01 AMaloof-airport-25580
02/19/2023, 11:52 AMfew-laptop-73260
02/19/2023, 3:21 PMpowerful-orange-86819
02/20/2023, 11:08 AMyml
stages:
- test
test:
image: cypress/browsers:node16.17.0-chrome106
parallel:
matrix:
- SUITES: "suite1.spec.js, suite2.specjs, suite3.spec.js"
the CI Lint validator says is correct but cypress returns an error.
Anyone know about this error?quaint-airplane-96634
02/20/2023, 11:34 AMfaint-ocean-92094
02/20/2023, 4:57 PMmelodic-artist-76036
02/20/2023, 6:11 PMcy.origin
and require
to import dependencies. Those dependencies are local modules (page objects) which I need for assertions. Locally, everything works like a charm, but on CI I get this error:
Error: Error: ENOENT: no such file or directory, open '/tmp/cypress/webpack-preprocessor/36c17fa865a97b9d11c9436638e044d7/cross-origin-cb-948eb7e9dc3ceb4e5222da0c9c591d18.js'
Now before posting the whole setup, does anyone have an idea what could be the issue here? It seems it can not find the sources required for cross origin callbacks.faint-ocean-92094
02/20/2023, 10:46 PMconst pdf = require('pdf-parse');
getPdfContent(pdfName) {
return pdf(fs.readFileSync('cypress/downloads/' + pdfName))
}
On my test I call
cy.task("getPdfContent", "Test PDF File.pdf").then(content => {
expect(content.text).to.have.string("Testing content")
})
Sometimes the test passes like a charm, but sometimes I get the error bad XRef Entry. For what I have read this is a problem with the PDF file but the PDF file I download is fine. Furthermore if I rerun the same process with the same file, it works fine.
So it looks like the problem is what readFileSync is passing to the pdf() function. My theory is that the process is not finished when pdf() wants to parse it, as it only happens sometimes.
But I can't figure out what is going on. Could it be that readFileSync is not working correctly everytime?
Is there a way to verify or wait for it to finish before calling pdf() on it?silly-student-97216
02/21/2023, 5:18 AM