Skip to content

Commit

Permalink
remove login command
Browse files Browse the repository at this point in the history
  • Loading branch information
juacompe committed May 3, 2024
1 parent 5966c38 commit c56e325
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { CypressBrowser } from "../../../e2e/browsers/CypressBrowser";
import { InvoiceListPage } from "../pages/InvoiceListPage";
import { LoginPage } from "../pages/LoginPage";

describe("List Invoices Page", () => {
let invoiceListPage: InvoiceListPage;

beforeEach(() => {
cy.visit("/invoices/2020");
cy.login();
invoiceListPage = new LoginPage(new CypressBrowser()).login();
});

describe("in laptop", () => {
beforeEach(() => {
cy.viewport(800, 600);
});
it("Prints an old invoice", () => {
cy.visit("/invoices/2020");
invoiceListPage.visit(2020);
shouldSeeShortcutLabelsToMakeItFriendlyToNewUsers();
shouldSeeLastestInvoiceNumber(cy);
clickPrintInvoice(cy, "202001-001");
Expand Down
14 changes: 0 additions & 14 deletions web/tests/e2e/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ Cypress.Commands.add("containsTotal", (total) => {
cy.get("div.v-data-table tr:last-child td:last-child").contains(total);
});

Cypress.Commands.add("login", (username, password) => {
cy.server();
cy.route({
method: "POST",
url: "/login/",
}).as("login");
username = username || "user";
password = password || "s3cr3t";
cy.input("#username", username);
cy.input("#password", password);
cy.get("#login-button").click();
cy.wait("@login");
});

Cypress.Commands.add("input", (key, value) => {
cy.get(key)
.click()
Expand Down

0 comments on commit c56e325

Please sign in to comment.