-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): e2e failing test using Cypress for #3
- Loading branch information
Showing
10 changed files
with
141 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules/ | ||
npm-debug.log | ||
failed-*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"projectId": "kqsspw" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
describe('cypress failed log', () => { | ||
beforeEach(() => { | ||
cy.visit('https://glebbahmutov.com') | ||
}) | ||
|
||
// this test fails on purpose | ||
it('finds aliens', () => { | ||
cy.contains('a', 'videos') | ||
.click() | ||
.wait(100) | ||
|
||
cy.url() | ||
.should('contain', 'videos') | ||
|
||
cy.contains('Aliens') | ||
.should('be.visible') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// *********************************************** | ||
// 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.addParentCommand("login", function(email, password){ | ||
// var email = email || "[email protected]" | ||
// 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() | ||
// }) | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// *********************************************** | ||
// This example defaults.js shows you how to | ||
// customize the internal behavior of Cypress. | ||
// | ||
// The defaults.js file is a great place to | ||
// override defaults used throughout all tests. | ||
// | ||
// *********************************************** | ||
// | ||
// Cypress.Server.defaults({ | ||
// delay: 500, | ||
// whitelist: function(xhr){} | ||
// }) | ||
|
||
// Cypress.Cookies.defaults({ | ||
// whitelist: ["session_id", "remember_token"] | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your other test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/guides/configuration#section-global | ||
// *********************************************************** | ||
|
||
// Import commands.js and defaults.js | ||
// using ES2015 syntax: | ||
import "./commands" | ||
import "./defaults" | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require("./commands") | ||
// require("./defaults") | ||
require('../..') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters