1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// *********************************************** This example commands.js
// shows you how to create the custom command: 'login'.
//
// The commands.js file is a great place to modify existing commands and create
// custom commands for use throughout your tests.
//
// You can read more about custom commands here:
// https://on.cypress.io/api/commands
// ***********************************************
//
// Cypress.Commands.add("login", function(email, password){ var email =
// email || "joe@example.com" var password = password || "foobar"
//
// var log = Cypress.Log.command({ name: "login", message: [email,
// password], consoleProps: function(){ return { email: email,
// password: password } } })
//
// cy .visit("/login", {log: false}) .contains("Log In", {log: false})
// .get("#email", {log: false}).type(email, {log: false}) .get("#password",
// {log: false}).type(password, {log: false}) .get("button", {log:
// false}).click({log: false}) //this should submit the form .get("h1",
// {log: false}).contains("Dashboard", {log: false}) //we should be on the
// dashboard now .url({log: false}).should("match", /dashboard/, {log:
// false}) .then(function(){ log.snapshot().end() }) }) import
// "/home/node/app/node_modules/cypress-testing-library/add-commands";
|