vue-psa-architecture/cypress/e2e/contacts/new.cy.ts

21 lines
510 B
TypeScript
Raw Normal View History

2023-02-03 11:23:44 +03:00
import { Page } from "../../support/pages";
describe("Create contact", () => {
beforeEach(() => {
cy.visit(Page.CreateContact);
});
it("should create a contact", () => {
const email = "foo@example.com";
cy.get("[cy-test=createContact-form-field-email]").type(email);
cy.get("[cy-test=createContact-button]").click();
cy.location("pathname").should("eq", Page.Contacts);
cy.get("[cy-test=contacts-table-col-email]")
.first()
.should("have.text", email);
});
});