Skip to content

Instantly share code, notes, and snippets.

@Leming1488
Leming1488 / images_tools.js
Last active October 26, 2023 12:04
images
const style = document.createElement('style');
style.innerHTML = `
.image-container {
position: relative;
overflow: hidden;
width: auto;
height: auto;
display: inline-block;
}
.image-container:hover .overlay {
@Leming1488
Leming1488 / login_form_test.js
Last active January 11, 2021 06:17
testining login form
it('Видим поля формы и они пустые, не видим ошибки', () => {
cy.get('[data-cy=password]').should('have.value', '');
cy.get('[data-cy=email]').should('have.value', '');
cy.get('[data-cy="email-error"]').should('not.visible');
});
it('Заполняем поле email не валидным значением, кликаем по кнопке войти, видим тект ошибки', () => {
cy.get('[data-cy=email]')
.type(user.invalid_email)
.should('have.value', user.invalid_email);
@Leming1488
Leming1488 / login.html
Last active January 14, 2021 04:43
form_html_login
<form data-cy="login" onsubmit="return false;">
<h3 class="title title--h3">Вход</h3>
<div class="auth_form-email-input-wrapper">
<div class="input_wrapper input_wrapper--xl input_wrapper--email" data-cy="email-wrapper">
<input type="email" placeholder="Эл. почта" name="email" class="input_element" data-cy="email" value="">
<label class="input_label">Эл. почта</label>
<div class="input_error" data-cy="email-error">Поле обязательно для заполнения</div>
</div>
@Leming1488
Leming1488 / registration_form.js
Created October 5, 2020 15:37
registration_form
describe('Регистрация', () => {
before(() => {
cy.visit('auth/registration');
cy.url().should('include', 'auth/registration');
cy.get('[data-cy=registration]').should('exist');
});
describe('Если не авторизован', () => {
it('Переходим на главную страницу, попадаем на страницу логина', () => {
cy.visit('/');
cy.url().should('include', 'login');
cy.get('[data-cy=login]').should('exist');
});
});
@Leming1488
Leming1488 / authentication_before.spec.js
Last active January 11, 2021 03:46
Authentication before cypress
describe('Authentication User', () => {
before(() => {
cy.clearCookies();
cy.visit('/', {
onBeforeLoad(window) {
delete window.fetch;
}
});
const user = require('../fixtures/user.json');
const usersInfo = require('../fixtures/users/input/users_info.json');
const errors = require('../fixtures/errors.json');
describe('Authentication User', () => {
before(() => {
cy.server();
cy.route({
method: 'GET',
@Leming1488
Leming1488 / sampleREADME.md
Created March 16, 2020 09:04 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here