mammoth-australia-81192
08/01/2022, 4:17 PMwooden-monitor-57304
08/01/2022, 4:32 PMnice-megabyte-63134
08/01/2022, 5:55 PMcypress-io/cypress
but the Circle CI is stuck at build
job with UNAUTHORIZED
warning. Do you know how to pass this?gray-kilobyte-89541
08/01/2022, 7:44 PMconst expectedLabel = cy.get('@tabs').eq(index).invoke('attr', 'id')
Nope. Not going to work, always pass it forward. I have a similar example where I show that we are getting the same DOM element references using two selectors https://glebbahmutov.com/cypress-examples/9.7.0/commands/querying.html#jquery-selectorsable-monkey-72947
08/01/2022, 8:00 PMcy.get('@tabs').eq(index).invoke('attr', 'id').then(tabId => {
expect(label).to.equal(tabId)
})
> always pass it forward
You mean .then(...)
it or something else?silly-oil-35249
08/01/2022, 8:34 PMafterEach
code getting run in the beforeEach
of a describe/it
? I can't reproduce it locally, it is only happening on CircleCI and only for one of our test files (we use the same pattern to delete database objects created in the afterEach
in all our test files). TL;DR: our clean up code runs before the objects are created and fails when the objects can't be deleted. If we re-run the spec file one or more times after failing it will succeed.gray-kilobyte-89541
08/01/2022, 9:16 PM.then(value => ...)
gray-kilobyte-89541
08/02/2022, 2:49 AMmelodic-dawn-73228
08/02/2022, 5:56 AMadorable-stone-42197
08/02/2022, 6:41 AMadorable-stone-42197
08/02/2022, 6:41 AMadorable-stone-42197
08/02/2022, 6:47 AMwitty-magazine-45881
08/02/2022, 9:09 AMcy.mount(
<div>
<MyComponent />
</div>
)
im getting error: "Cannot read properties of undefined (reading 'devtoolsRawSetupState')"limited-continent-86055
08/02/2022, 11:20 AMlimited-continent-86055
08/02/2022, 11:20 AMlimited-continent-86055
08/02/2022, 11:20 AMlimited-continent-86055
08/02/2022, 11:21 AMjs
setupNodeEvents(on, config = {}) {
const env = process.env.NODE_ENV;
const envConfig = getConfig(env);
config.env['MAILOSAUR_API_KEY'] = envConfig.mailosaur.apiKey;
config['baseUrl'] = envConfig.baseUrl;
on('task', {
'db:seed': async () => {
await seedData();
},
'db:teardown': async () => {
await teardownData();
},
});
return config;
},
limited-continent-86055
08/02/2022, 11:22 AMlimited-continent-86055
08/02/2022, 11:23 AMpolite-alarm-78904
08/02/2022, 2:25 PMlate-planet-4481
08/02/2022, 2:32 PMcy.('[data-test="myElement"]').should('be.visible')
or you can even make visibility part of the selector...
`cy.('[data-test="myElement"]:visible').should('exist')`~~
I'm not sure the answer above helps your situation actually. I doubt "visible" means unobscured. Rather than checking, why not just scroll it into view regardless?
Someone else here recently was trying to click an obscured element, and they had luck setting the scrollBehavior
option when calling .click()
to bring the element into view first. I believe they used scrollBehavior: false
.polite-alarm-78904
08/02/2022, 2:41 PMcy.get("element").should("not.be.visible")
cy.get("listItem").click()
cy.get("element").should("be.visible")
acceptable-hamburger-48790
08/02/2022, 2:42 PMimportant-rocket-19427
08/02/2022, 3:10 PMlate-planet-4481
08/02/2022, 3:11 PM.click()
to autoscroll, as gurudatt26 said. Or use scrollIntoView()
.acceptable-hamburger-48790
08/02/2022, 5:49 PMbrainy-librarian-80110
08/03/2022, 4:03 AMbrainy-librarian-80110
08/03/2022, 4:03 AMlimited-continent-86055
08/03/2022, 7:05 AMlimited-continent-86055
08/03/2022, 7:05 AM