-
Notifications
You must be signed in to change notification settings - Fork 0
sprint6/step1 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "plugins": ["cypress"], | ||
| "extends": ["plugin:cypress/recommended"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { defineConfig } from "cypress"; | ||
|
|
||
| export default defineConfig({ | ||
| e2e: { | ||
| baseUrl: "http://localhost:3000/", | ||
| setupNodeEvents(on, config) { | ||
| // implement node event listeners here | ||
| }, | ||
| }, | ||
|
|
||
| component: { | ||
| devServer: { | ||
| framework: "create-react-app", | ||
| bundler: "webpack", | ||
| }, | ||
| }, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import { | ||
| testBun, | ||
| modalButton, | ||
| constructorSection, | ||
| } from "../../../src/utils/constant"; | ||
|
|
||
| console.log(testBun); | ||
|
|
||
| describe("service is available", function () { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| beforeEach(() => { | ||
| cy.viewport(1280, 720); | ||
| cy.visit("http://localhost:3000"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| // eslint-disable-next-line cypress/no-unnecessary-waiting | ||
| cy.wait(3000); | ||
| }); | ||
| it("should open burger constructor page by default and test modal", function () { | ||
| cy.contains(testBun).click(); | ||
| cy.get(`${modalButton}`).click(); | ||
| cy.contains("Сыр с астероидной плесенью").click(); | ||
| cy.get(`${modalButton}`).click(); | ||
| cy.contains("Соус традиционный галактический").click(); | ||
| cy.get(`${modalButton}`).click(); | ||
| cy.contains(testBun).click(); | ||
| cy.get(`${modalButton}`).click(); | ||
| }); | ||
|
|
||
| it("should drag and drop ingredients, login and place an order", function () { | ||
| cy.get(`img[alt*="${testBun}"]`).trigger("dragstart").trigger("dragleave"); | ||
| cy.get(constructorSection) | ||
| .trigger("dragenter") | ||
| .trigger("dragover") | ||
| .trigger("drop") | ||
| .trigger("dragend"); | ||
|
|
||
| cy.get('img[alt*="Сыр с астероидной плесенью"]') | ||
| .trigger("dragstart") | ||
| .trigger("dragleave"); | ||
| cy.get(constructorSection) | ||
| .trigger("dragenter") | ||
| .trigger("dragover") | ||
| .trigger("drop") | ||
| .trigger("dragend"); | ||
|
|
||
| cy.get('img[alt*="Мини-салат Экзо-Плантаго"]') | ||
| .trigger("dragstart") | ||
| .trigger("dragleave"); | ||
| cy.get(constructorSection) | ||
| .trigger("dragenter") | ||
| .trigger("dragover") | ||
| .trigger("drop") | ||
| .trigger("dragend"); | ||
|
|
||
| cy.get("button").contains("Оформить заказ").click(); | ||
|
|
||
| cy.get('input[type*="email"]').click().type("jkjkkj@yandex.ru"); | ||
| cy.get('input[type*="password"]').click().type("123456"); | ||
| cy.get("button").contains("Войти").click(); | ||
| // eslint-disable-next-line cypress/no-unnecessary-waiting | ||
| cy.wait(2000); | ||
| cy.get("button").contains("Оформить заказ").click(); | ||
| }); | ||
| }); | ||
| 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" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /// <reference types="cypress" /> | ||
| // *********************************************** | ||
| // This example commands.ts 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 will overwrite an existing command -- | ||
| // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
| // | ||
| // declare global { | ||
| // namespace Cypress { | ||
| // interface Chainable { | ||
| // login(email: string, password: string): Chainable<void> | ||
| // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
| // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
| // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
| // } | ||
| // } | ||
| // } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
| <title>Components App</title> | ||
| </head> | ||
| <body> | ||
| <div data-cy-root></div> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // *********************************************************** | ||
| // This example support/component.ts 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' | ||
|
|
||
| // Alternatively you can use CommonJS syntax: | ||
| // require('./commands') | ||
|
|
||
| import { mount } from 'cypress/react' | ||
|
|
||
| // Augment the Cypress namespace to include type definitions for | ||
| // your custom command. | ||
| // Alternatively, can be defined in cypress/support/component.d.ts | ||
| // with a <reference path="./component" /> at the top of your spec. | ||
| declare global { | ||
| namespace Cypress { | ||
| interface Chainable { | ||
| mount: typeof mount | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Cypress.Commands.add('mount', mount) | ||
|
|
||
| // Example use: | ||
| // cy.mount(<MyComponent />) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // *********************************************************** | ||
| // This example support/e2e.ts 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' | ||
|
|
||
| // Alternatively you can use CommonJS syntax: | ||
| // require('./commands') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в задеплоенном приложении просто черный экран https://disk.yandex.ru/i/78GIs7OZt8OoVQ