enough-fireman-4779
12/07/2022, 10:36 AMChooseRandomShop() {
cy.get('table [href]').then( myLinks => {
const randomLink = Cypress._.sample(myLinks)
cy.wrap(randomLink).click()
})strong-chef-89202
12/07/2022, 11:28 AMbeforeEach phase:
typescript
cy.fixture(pathToDB, null).then((rawData) => {
// Some cursed-voodo magic to get the data as an ArrayBuf
const buf = Cypress.Buffer.from(rawData);
const database = new Uint8Array(buf).buffer;
cy.fixture(pathToPassword).then((password: string) => {
Keepass.loadDatabase(database, password);
});
});
While this works, I feel like I am missing something to initialize it globally once. I tried the support/e2e.ts but that did not work. Is there a better way to do this?lemon-wall-91819
12/07/2022, 11:30 AMlemon-wall-91819
12/07/2022, 11:35 AMgray-kilobyte-89541
12/07/2022, 11:38 AMgray-kilobyte-89541
12/07/2022, 11:39 AMgray-kilobyte-89541
12/07/2022, 11:40 AMnutritious-artist-49849
12/07/2022, 11:48 AMstrong-chef-89202
12/07/2022, 12:05 PMgreen-jordan-14676
12/07/2022, 12:13 PMfresh-doctor-14925
12/07/2022, 12:17 PMenough-fireman-4779
12/07/2022, 12:30 PMcareful-quill-5790
12/07/2022, 12:51 PM<my-custom-element>
#shadow-root
<ul>
<li data-testid="id-a">
<slot name="slot-a" />
</li>
<li data-testid="id-b">
<slot name="slot-b" />
</li>
</ul>
<a slot="slot-b" class="looking-for-this" />
</my-custom-element>
cy.get('my-custom-element').shadow().find('[data-testid="id-b"]').???
My goal would be checking if element "a" with class "looking-for-this" is properly rendered under data-testid="id-b". Unfortunately I couldn't find a way to query the assigned nodes to data-testid="id-b". Cypress seems only able to find the empty slot. Do you think is there any workaround? Any help would be greatly appreciated!orange-portugal-35791
12/07/2022, 1:08 PMadorable-stone-42197
12/07/2022, 1:09 PMgray-kilobyte-89541
12/07/2022, 2:07 PMfull-postman-68262
12/07/2022, 2:16 PMCypress.on to tap into events on run:start and fail to handle printing and clearing the array, but it seems like console.log doesn't do anything within Cypress.on, and Cypress.log() only prints out to the browser console instead of the container stdout. Does anyone have any suggestions for ways I could figure out how to print to stdout in Cypress.on or just other ideas of how I could handle this type of logging without having to add beforeEach and afterEach hooks to every test just to handle this?big-waitress-61452
12/07/2022, 3:06 PMfresh-doctor-14925
12/07/2022, 3:25 PMnpx cypress open --e2e --browser electronmysterious-belgium-25713
12/07/2022, 3:42 PMdry-scooter-25612
12/07/2022, 4:07 PMenough-truck-68085
12/07/2022, 5:42 PMnutritious-analyst-96582
12/07/2022, 5:42 PMthousands-gpu-36872
12/07/2022, 8:57 PMgray-kilobyte-89541
12/07/2022, 8:58 PMreturn to skip, but I would think this would make the code harder to understandthousands-gpu-36872
12/07/2022, 9:00 PMbrave-river-4142
12/07/2022, 9:13 PMenough-truck-68085
12/07/2022, 9:18 PMcy.login() in every test but one?
Am I understanding that?
If so can you just organize your tests using describe hooks so that only the tests that need login inherit that setup while other tests share a different setup?thousands-gpu-36872
12/07/2022, 9:20 PMloud-park-10778
12/07/2022, 9:23 PM