blue-noon-19179
03/19/2023, 2:19 PMclever-night-39043
03/20/2023, 3:17 AMfresh-shampoo-23978
03/20/2023, 7:04 AMwhite-waitress-37720
03/20/2023, 7:53 AMblue-battery-71202
03/20/2023, 11:43 AMimport { fromNodeProviderChain } from '@aws-sdk/credential-providers';
error which was the following:
ts
'import' and 'export' may appear only with 'sourceType: module'
I've tried turning esModuleInterop: false
however, that would conclude in some of our dependencies can not resolve like this:
ts
import aws from 'aws-sdk'
aws.config.update({'us-east-1'})
When opening cypress it throws "aws can be undefined"
Our setup consist of both cucumber test cases, and simple it(...)
test cases as well.
Anyone has any idea where could I start investigating potential fixes?aloof-minister-26761
03/20/2023, 12:41 PMstraight-chef-47891
03/20/2023, 10:26 PMcypress.config.ts
I have this code snippet:
typescript
const legacyConfig = require('./cypress/plugins/index');
e2e: {
setupNodeEvents(on, config) {
return legacyConfig(on, config); // since we still use the old plugin file to override configs
},
...
}
However, Datadog is asking to use something like this:
typescript
e2e: {
setupNodeEvents: require('dd-trace/ci/cypress/plugin'),
supportFile: 'cypress/plugins/index.ts',
...
}
When I use the one that Datadog suggests, I get this error:
> Error: Webpack Compilation Error
> ./node_modules/js-library-detector/library/libraries.js 1360:107
> Module parse failed: Unexpected token (1360:107)
> 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
> | npm: 'nuxt',
> | test: function(win) {
> if (win.__NUXT__ || win.$nuxt || [...win.document.querySelectorAll('*')].some(el => el.__vue__?.nuxt)) {
> | return { version: UNKNOWN_VERSION };
> | }wooden-megabyte-23794
03/21/2023, 8:16 AMwooden-megabyte-23794
03/21/2023, 8:28 AMrough-flower-20110
03/21/2023, 9:14 AMearly-rose-80739
03/21/2023, 1:50 PM${baseUrl}/products/
);
It seems often occurred from cy.url() or cy.visit().
I guess and survey to the reasons:
1. react 18 useffect render twice, or next.js link
2. our test environment api response time is too unstable
3. GitHub ubuntu test environment
I tried some workarounds:
1. use then chain -> failed
2. cy.wait(3000) -> success, but is not a good method
3. use intercept -> failed
I found one solution is using node 18 and 127.0.0.1, but it will affect too much so I didnt do yet.
could someone give me any advice?wooden-helmet-43105
03/21/2023, 3:45 PMsome-lifeguard-48779
03/21/2023, 7:26 PMworried-addition-53678
03/21/2023, 8:39 PMhappy-megabyte-98400
03/22/2023, 3:16 AMbillowy-pharmacist-61146
03/22/2023, 7:14 AMinput
element. I can't find the way to mount it with v-model
(or modelValue + @update).
I've tried this unsuccessfully :
cy.mount(MyField, {
props: {
modelValue: email,
onUpdate: (val: string) => (email = val),
'onUpdate:modelValue': (val: string) => (email = val),
'onUpdate:model-value': (val: string) => (email = val),
},
})
Thanks !hundreds-helicopter-24420
03/22/2023, 8:48 AMjs
let genreF = cy.get("[data-cy=genre-f]");
if (genreF.its('tagName') === "DIV") {
// New app
genreF.parent().should('have.attr', 'aria-checked', 'true')
} else {
// Legacy app
genreF.should('be.checked')
}
best-window-49967
03/22/2023, 10:40 AMnice-airport-76935
03/22/2023, 1:56 PMmost-table-70794
03/22/2023, 3:00 PMcypress run
it incorrectly reports that my website is unavailable.
When using cypress open
it works fine and manage to run the spec just fine.busy-agency-3812
03/22/2023, 3:48 PMCypress.Commands.add('setExternalIds', (Array) => {
cy.intercept(
'GET',
`**/${Cypress.env('API_BASE_URL')}/v2/divisions/*`,
(req) => {
req.reply({
external_ids: Array,
config: {
entity_configurations: {
entity: '82374982734',
},
I only included part of the json body because the entire json body is 500 lines long and at least 10 levels of nesting. When I include the json body and I send a param, the param displays correctly in the network tab when running the Cypress test. I just don't like having these very long response bodies in my support/commands file
How can I move them outside this support file? I would love a base fixture that I can iterate and edit parts of. If I nest the cy.intercept within a cy.fixture call, it does not update the external id value using a spread operator for the rest of the fixture body. I have tried variations of the code below and I don't think it will work with this deeply nested of a structure.
Cypress.Commands.add('setExternalIds', (Array) => {
cy.fixture('../../fixtures/SetupFiles/divisions')
.then((response) => {
cy.intercept(
'GET',
`**/${Cypress.env('API_BASE_URL')}/v2/divisions/*`,
(req) => {
req.reply({
external_ids: Array,
...response
That said, how should I organize/store/call the remaining part of the reply?
I could create multiple files within /support and keep the long response body, but have more organization around my different commands, but I'd like to know what other people are doing.purple-ice-75399
03/22/2023, 4:54 PMjs
cy.get('[class*="spanWithText"]')
.contains(option) // option could be 501-1000
.closest('label')
I attempted the examples here: https://glebbahmutov.com/cypress-examples/recipes/non-breaking-space.html#non-breaking-space, besides manually entering the zero-width code since not all choices will have zero-width spaces in our other cases, and would just like to enter what the human sees and without manipulating a large amount of HTML.
Our developer used this: https://discord.com/channels/755913899261296641/961325024114008064/1086073596499214367 but the error message doesn't help when it goes wrong, so I was hoping to find something more Cypress-y to handle this, especially since I need to chain commands after finding the correct option.
Does anyone know how I could go about this?
Thanks!salmon-holiday-61646
03/22/2023, 7:35 PMprehistoric-market-22707
03/22/2023, 10:04 PMstraight-chef-47891
03/23/2023, 4:00 AMcy.go('forward')
then cy.go('back')
on my tests to check if it still shows the last state of the page. However, it seems no data is displayed in the table after doing the commands using Chrome and Edge. Works fine in Electron and Firefox.
 - shows 1 record
 - still shows 1 record
===
 - shows 1 record
 - shows nothing
I trie to disable as much as I can on my plugin/index.ts
file with the following to no avail:
typescript
if (browser.name === 'chrome' || browser.name === 'edge') {
launchOptions.args.push('--disable-features=SameSiteByDefaultCookies,CrossSiteDocumentBlockingIfIsolating,CrossSiteDocumentBlockingAlways,IsolateOrigins,site-per-process');
return launchOptions;
}
famous-eye-40764
03/23/2023, 8:18 AM<my-button href="https://www.google.com/">Link</my-button>
);hundreds-photographer-6057
03/23/2023, 12:41 PMlively-balloon-98986
03/23/2023, 2:26 PMwonderful-greece-63551
03/23/2023, 5:08 PMred-diamond-5625
03/23/2023, 5:53 PM