Skip to content

Instantly share code, notes, and snippets.

View robertguss's full-sized avatar

Robert Guss robertguss

View GitHub Profile

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@robertguss
robertguss / within.spec.js
Created April 11, 2022 18:22
How to use the .within() method in Cypress tests.
describe("Within", () => {
it("makes sure the CTA button in the home page hero links to the correct section", () => {
cy.visit("https://learn.cypress.io/");
cy.get(".bg-course-hero").within(() => {
cy.get("a").invoke("attr", "href").should("eq", "#courses");
});
});
it.only("makes sure all the links in the courses dropdown link to the correct page", () => {
@robertguss
robertguss / invoke.spec.js
Created April 11, 2022 17:34
How to use the .invoke() method in your Cypress tests
describe("Invoke", () => {
it("invokes the slice method on an array", () => {
cy.request("https://jsonplaceholder.typicode.com/posts")
.its("body")
.invoke("slice", 0, 5)
.its("length")
.should("eq", 5);
});
it("the nav dropdown toggles the aria-expanded property when opened or closed", () => {