Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Проект Космическая Бургерная

## Скрипты
## О чём этот проект:

Чтобы запустить проект вы должны набрать:
Эта работа - это финальный проект созданный в процессе обучения на курсе Реакт разарботчик в Яндекс Практикум. Представляет собой приложение, где можно собирать космический бургер из различных ингредиентов, создавать заказы, просматривать их, редактировать информацию о пользователе. Вся информация сохраняется на сервере. Также реализована регистрация и авторизация пользователя.

### `npm start`
### Что было сделано:

Фронтенд:

- HTML5, CSS, JS, TypeScript, Redux, Redux-Thunk, WebSocket
- React (Хуки, функциональные компоненты, роутинг)
- Тестирование Cypress, react-testing-library

- [Ссылка на проект](https://gremwiz1.github.io/react-burger/)
1 change: 1 addition & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
9 changes: 9 additions & 0 deletions cypress/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
"cypress"
],
"extends": [
"plugin:cypress/recommended"
]
}

5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
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"
}
5 changes: 5 additions & 0 deletions cypress/integration/1-getting-started/getting-start.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('service is available', function () {
it('should be available on localhost:3000', function () {
cy.visit('http://localhost:3000');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
describe('burger ingredients drag and drop, create order', function () {
before(function () {
cy.visit('http://localhost:3000/#');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вам надо было сделать testUrl в виде константы, чтобы 1 раз можно было изменить и везде изменилось бы

});

it('create burger', function () {
cy.contains('Флюоресцентная булка').trigger('dragstart');
cy.get('[data-test="burgerConstructor"]').trigger('drop');
cy.contains('Соус традиционный галактический').trigger('dragstart');
cy.get('[data-test="burgerConstructor"]').trigger('drop');
cy.get('[data-test="burgerConstructor"]').contains('Флюоресцентная булка').should('exist');
cy.get('[data-test="burgerConstructor"]').contains('Соус традиционный галактический').should('exist');
});
it('create order', function () {
cy.get('button').contains('Оформить заказ').click();
cy.url().should('include', 'http://localhost:3000/#/login');
cy.get('input[name="email"]').type('[email protected]');
cy.get('input[name="password"]').type('test1234');
cy.contains('Войти').click();
cy.url().should('include', 'http://localhost:3000/#');
cy.contains('Оформить заказ').click();
cy.contains('Ваш заказ начали готовить');
});
it('should close the modal window', function () {
cy.get('[class^=CloseIcon]').click();
cy.contains('Ваш заказ начали готовить').should('not.exist');
cy.contains('Соберите бургер');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe('burger ingredients exist, open and close modal window', function () {
before(function () {
cy.visit('http://localhost:3000/#');
});

it('should exist words', function () {
cy.contains('Булки');
cy.contains('Соусы');
cy.contains('Начинки');
});
it('should open modal window', function () {
cy.contains('Соус традиционный галактический').click();
cy.contains('Детали ингредиента');
cy.url().should('include', '/ingredients/');
});
it('should close the modal window', function () {
cy.get('[class^=CloseIcon]').click();
cy.contains('Детали ингредиента').should('not.exist');
cy.url().should('not.include', '/ingredients/');
});

});
11 changes: 11 additions & 0 deletions cypress/integration/feed/feed.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('service is available on route feed', function () {
before(function () {
cy.visit('http://localhost:3000/#/feed');
});

it('should feed contains', function () {
cy.contains('Лента заказов');
cy.contains('Выполнено за все время');
cy.contains('Выполнено за сегодня');
});
});
11 changes: 11 additions & 0 deletions cypress/integration/login/login.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('service is available on route login', function () {
before(function () {
cy.visit('http://localhost:3000/#/login');
});

it('should login contains', function () {
cy.contains('Вход');
cy.contains('E-mail');
cy.contains('Пароль');
});
});
22 changes: 22 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference types="cypress" />
// ***********************************************************
// 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)

/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
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 will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// 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'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading