Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from saisandeepvaddi/v2.0.0
V2.0.0
- Loading branch information
Showing
29 changed files
with
833 additions
and
121 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"eslint.enable": false | ||
} |
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
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 @@ | ||
import {startServer} from "./index" | ||
|
||
startServer(); |
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
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
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 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000" | ||
} |
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": "hello@cypress.io", | ||
"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,125 @@ | ||
describe("Tests App top-most ui", () => { | ||
before(() => { | ||
cy.visit("/"); | ||
}); | ||
|
||
it("Checks if topbar loaded", () => { | ||
cy.get(".bp3-fixed-top > .bp3-align-left > .bp3-navbar-heading").should( | ||
"have.text", | ||
"Ten Hands" | ||
); | ||
}); | ||
|
||
it("Checks if theme button is working", () => { | ||
cy.getByTestId("theme-light").click(); | ||
cy.wait(2000); | ||
cy.getByTestId("theme-dark").click(); | ||
}); | ||
|
||
it("Checks if new project button works", () => { | ||
cy.getByTestId("new-project-button").then(subject => { | ||
subject.click(); | ||
cy.wait(1000); | ||
cy.get(".bp3-drawer").then(subject => { | ||
cy.getByText("Add Project", { container: subject }).should("exist"); | ||
cy.getByText("Project Name", { container: subject }).should("exist"); | ||
cy.getByText("Project Path", { container: subject }).should("exist"); | ||
cy.getByText("Project Type", { container: subject }).should("exist"); | ||
cy.getByText("Tasks", { container: subject }).should("exist"); | ||
cy.getByText("Save Project", { container: subject }).should("exist"); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("Checks Project", () => { | ||
before(() => { | ||
cy.visit("/"); | ||
// I added project folder of 'ten-hands'. If you have cloned this project add one before this test case. | ||
cy.get(".Pane1").then(sidebar => { | ||
cy.getByText("ten-hands", { container: sidebar }) | ||
.click() | ||
.wait(2000); | ||
}); | ||
}); | ||
|
||
it("Checks ten-hands project exists", () => { | ||
cy.getByText("New Task") | ||
.should("exist") | ||
.getByText("build:desktop") | ||
.should("exist") | ||
.getByText("yarn build:desktop") | ||
.should("exist"); | ||
}); | ||
|
||
it("Checks New Task UI", () => { | ||
cy.getByText("New Task") | ||
.click() | ||
.get(".bp3-drawer") | ||
.then(drawer => { | ||
cy.getByText("Add Task", { container: drawer }).should("exist"); | ||
cy.getByText("Name", { container: drawer }).should("exist"); | ||
cy.getByText("Path", { container: drawer }).should("exist"); | ||
cy.getByText("Task", { container: drawer }).should("exist"); | ||
cy.getByText("Save Task", { container: drawer }).should("exist"); | ||
}); | ||
}); | ||
|
||
it("Adds a task", () => { | ||
cy.getByLabelText(/name/i).type("Test Task"); | ||
cy.getByLabelText(/task/i).type("node dummy-file.js"); | ||
cy.getByTestId("save-task-button").click(); | ||
cy.wait(2000); | ||
cy.getByText("Test Task").should("exist"); | ||
cy.getByText("node dummy-file.js").should("exist"); | ||
cy.getByText("node dummy-file.js") | ||
.scrollIntoView({ easing: "linear" }) | ||
.should("be.visible"); | ||
}); | ||
|
||
it("Runs a task", () => { | ||
cy.getByText("Test Task") | ||
.scrollIntoView({ easing: "linear" }) | ||
.closest(".bp3-card") | ||
.then(card => { | ||
cy.getByTestId(/stop-task-button/i, { container: card }).should( | ||
"be.disabled" | ||
); | ||
cy.getByTestId(/start-task-button/i, { container: card }).click(); | ||
cy.getByTestId(/stop-task-button/i, { container: card }).should( | ||
"not.be.disabled" | ||
); | ||
cy.wait(5000); // By that time dummy task is disabled | ||
cy.getByTestId(/start-task-button/i, { container: card }).should( | ||
"not.be.disabled" | ||
); | ||
cy.getByTestId(/stop-task-button/i, { container: card }).should( | ||
"be.disabled" | ||
); | ||
}); | ||
}); | ||
|
||
after(() => { | ||
// Delete the added task in the end | ||
|
||
cy.getByText("node dummy-file.js") | ||
.scrollIntoView({ easing: "linear" }) | ||
.should("be.visible"); | ||
|
||
cy.getByText("Test Task") | ||
.closest(".bp3-card") | ||
.then(card => { | ||
cy.getByTitle("Delete Task", { container: card }); | ||
}) | ||
.click() | ||
.wait(1000); | ||
|
||
cy.getByText(/Are you sure you want to delete/gi).should("exist"); | ||
|
||
cy.getByText("Yes, Delete") | ||
.click() | ||
.wait(2000); | ||
|
||
cy.queryByText("node dummy-file.js").should("not.exist"); | ||
}); | ||
}); |
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 plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
} |
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,25 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add("login", (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
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,22 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your 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/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import "./commands"; | ||
|
||
import "@testing-library/cypress/add-commands"; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
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
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
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
Oops, something went wrong.