polite-alarm-78904
06/17/2022, 11:29 AMselfcerts-item-${id}
)
.scrollIntoView()
.should("be.visible")`adorable-stone-42197
06/17/2022, 11:45 AMred-toddler-79937
06/17/2022, 12:56 PMcareful-tent-30457
06/17/2022, 1:44 PMcareful-tent-30457
06/17/2022, 1:48 PMgray-kilobyte-89541
06/17/2022, 2:13 PMgray-kilobyte-89541
06/17/2022, 2:13 PMswift-kitchen-62493
06/17/2022, 3:24 PMfresh-doctor-14925
06/17/2022, 3:59 PM{force: true}
swift-kitchen-62493
06/17/2022, 4:01 PMfresh-doctor-14925
06/17/2022, 4:05 PMfresh-doctor-14925
06/17/2022, 4:06 PMmodern-addition-58981
06/17/2022, 5:24 PMbitter-fountain-36713
06/17/2022, 6:28 PMmagnificent-finland-58048
06/17/2022, 6:52 PMmagnificent-finland-58048
06/17/2022, 6:53 PMbitter-fountain-36713
06/17/2022, 7:09 PMcy.contains('div','your text here)
with the text of the button. NOTE: cy.contains()
will get the first matching element in the DOM so use whatever selectors you may need to match the one you need.aloof-beach-98822
06/17/2022, 9:26 PMbitter-fountain-36713
06/17/2022, 11:39 PMCypress._.random(0, 23)
to get a random number from 1 to 24. Then use the random number to get the corresponding index of the array.aloof-beach-98822
06/18/2022, 2:58 AMfresh-doctor-14925
06/18/2022, 9:03 AM.contains('div', 'text')
combined with .click()
is super helpful for quick fixes, note that Josh said "For now" π
Try not to become too reliant on this approach, though. Otherwise you'll spend most of your time updating tests that are failing due to strings being changedcareful-tent-30457
06/18/2022, 10:56 AMcypress/support/commands
file. thought ppl would like to knowgray-kilobyte-89541
06/18/2022, 1:04 PMeq
command like @bitter-fountain-36713 wrote. Here it is https://github.com/bahmutov/cypress-examples/commit/3b62f408692994a07beac058509ca863c42c4d9daloof-beach-98822
06/18/2022, 7:57 PMmammoth-manchester-71430
06/19/2022, 4:21 PMmammoth-manchester-71430
06/19/2022, 4:27 PMmammoth-manchester-71430
06/20/2022, 3:33 AMnice-businessperson-99732
06/20/2022, 9:04 AMgreen-book-63455
06/20/2022, 9:15 AMnice-businessperson-99732
06/20/2022, 9:26 AM