-
Notifications
You must be signed in to change notification settings - Fork 0
Sprint 6/step 1 #8
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
Open
gremwiz1
wants to merge
14
commits into
main
Choose a base branch
from
sprint-6/step-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3daae65
refactoring: delete some Rootstate from components
gremwiz1 dae0352
added scrollIntoView in component burger-ingredients
gremwiz1 9986958
install plugins for test and deploy, added some command in scripts
gremwiz1 e100ad3
Added some cypress tests
gremwiz1 074c0a5
added test cypress burger drag and drop, create order
gremwiz1 b42a88a
added test itemsReducer
gremwiz1 5c0a5c4
added orderReducer test
gremwiz1 8616a27
added test cartBurgerConstructorReducer
gremwiz1 cea7f9e
added userReducer test
gremwiz1 907dba2
added wsReducer test
gremwiz1 6a63698
update readme.md and change some things
gremwiz1 56bc124
fix update readme.md
gremwiz1 56a43dc
change readme.md
gremwiz1 aeb0bbb
fix url in cypress tests
gremwiz1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 +1,15 @@ | ||
# Проект Космическая Бургерная | ||
|
||
## Скрипты | ||
## О чём этот проект: | ||
|
||
Чтобы запустить проект вы должны набрать: | ||
Эта работа - это финальный проект созданный в процессе обучения на курсе Реакт разарботчик в Яндекс Практикум. Представляет собой приложение, где можно собирать космический бургер из различных ингредиентов, создавать заказы, просматривать их, редактировать информацию о пользователе. Вся информация сохраняется на сервере. Также реализована регистрация и авторизация пользователя. | ||
|
||
### `npm start` | ||
### Что было сделано: | ||
|
||
Фронтенд: | ||
|
||
- HTML5, CSS, JS, TypeScript, Redux, Redux-Thunk, WebSocket | ||
- React (Хуки, функциональные компоненты, роутинг) | ||
- Тестирование Cypress, react-testing-library | ||
|
||
- [Ссылка на проект](https://gremwiz1.github.io/react-burger/) |
This file contains hidden or 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 @@ | ||
{} |
This file contains hidden or 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,9 @@ | ||
{ | ||
"plugins": [ | ||
"cypress" | ||
], | ||
"extends": [ | ||
"plugin:cypress/recommended" | ||
] | ||
} | ||
|
This file contains hidden or 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 hidden or 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 @@ | ||
describe('service is available', function () { | ||
it('should be available on localhost:3000', function () { | ||
cy.visit('http://localhost:3000'); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
cypress/integration/burger-ingredients/burger-ingredients-dnd-create-order.spec.js
This file contains hidden or 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,29 @@ | ||
describe('burger ingredients drag and drop, create order', function () { | ||
before(function () { | ||
cy.visit('http://localhost:3000/#'); | ||
}); | ||
|
||
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('Соберите бургер'); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
cypress/integration/burger-ingredients/burger-ingredients-modal.spec.js
This file contains hidden or 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 @@ | ||
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/'); | ||
}); | ||
|
||
}); |
This file contains hidden or 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,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('Выполнено за сегодня'); | ||
}); | ||
}); |
This file contains hidden or 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,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('Пароль'); | ||
}); | ||
}); |
This file contains hidden or 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 @@ | ||
/// <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 | ||
} |
This file contains hidden or 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 will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) |
This file contains hidden or 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,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') |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Вам надо было сделать
testUrl
в виде константы, чтобы 1 раз можно было изменить и везде изменилось бы