This commit is contained in:
Lukáš Kaňka
2023-08-15 18:35:50 +02:00
commit ea3e372146
10019 changed files with 2548539 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import { AaaAuto } from "cypress/page_objects/homepage";
const acka = new AaaAuto();
describe("Homepage AAA Auto", () => {
beforeEach(() => {
acka.hlavnistrana().rozliseni().cookiespotvrzeni();
})
it("horni hlavickova lista", () => {
acka.hlavicka();
});
it("slider bamer", () => {
acka.slider();
});
it("filter bar", () => {
acka.filterbar();
});
});

View File

@ -0,0 +1,37 @@
describe("Homepage AAA Auto", () => {
it("Filtrování vozu škoda Citigo a ověření zobrazení výsledků", () => {
cy.viewport(1920, 1080);
// Na homepage AAA (aaaauto.cz) vyplnte filter bar a potvrdte.
cy.visit("https://www.aaaauto.cz/");
// Potvrzení cookies
cy.contains("Pouze nezbytné cookies").click();
// Kliknutí na filtr značek
cy.get("#car_filter_make").click();
// Vybrání značky škoda
cy.contains("Škoda").click();
// Kliknutí na filtr modelů
cy.get("#car_filter_model").click();
// Vybrán model Citigo
cy.contains("Citigo").click();
// Kliknutí Stáří Vozu
cy.get("#car_filter_yearMin-topForm").click();
// Nastavení ve výběru vozu do stáří deseti let
cy.contains('Do 10 let').click();
cy.get("button[data-slider-filter-year-save]").click();
// Kliknutí na Vyberte cenu
cy.get("#car_filter_priceMax-topForm").click();
cy.contains("Do 200 000 Kč").click();
cy.get("button[data-slider-filter-price-save]").click();
// Kliknutí na Vyberte typ vozů
cy.get("#car_filter_category").click();
cy.contains("Úsporné vozy").click()
// Hledej
cy.get('form[name="car_filter"]').submit();
// Zkontrolovat výsledek filtrovaní
cy.get("#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(1) > span > span").contains("Škoda").should("be.visible");
cy.get('#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(2) > span > span').contains("Citigo").should("be.visible");
cy.get("#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(3) > span").contains("Rok od: 2013").should("be.visible");
cy.get("#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(4) > span").contains("Cena do: 200 000 Kč").should("be.visible");
cy.get("#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(5) > span > span").contains("Malé a ECO vozy").should("be.visible");
});
});

View File

@ -0,0 +1,47 @@
import { AaaAuto } from "cypress/page_objects/homepage";
import { Filtrovani } from "cypress/page_objects/filtrovani";
const acka = new AaaAuto();
const filtr = new Filtrovani();
// Filtry overeni
const znackaOvereni = "Škoda";
const modelOvereni = "Citigo";
const stariOvereni = "Rok od: 2013";
const cenaOvereni = "Cena do: 200 000 Kč";
const kategorieOvereni = "Malé a ECO vozy";
// Filtry vyber
const znackaVyber = "Škoda";
const typModelu = "Citigo";
const stariAuta = "Do 10 let";
const vyberCeny = "Do 200 000 Kč";
const vyberKategorie = "Úsporné vozy";
describe("Homepage AAA Auto", () => {
beforeEach(() => {
acka.hlavnistrana().rozliseni().cookiespotvrzeni();
});
it("Filtrování vozu škoda Citigo a ověření zobrazení výsledků", () => {
acka
.clickMenuZnacka()
.vyberZnacky(znackaVyber)
.clickMenuFiltrModelu()
.vyberModeluAuta(typModelu)
.clickMenuStariAuta()
.vyberStariAuta(stariAuta)
.potvrzeniStariAuta()
.clickMenuCenyAuta()
.vyberCenyAuta(vyberCeny)
.potvrzeniCenyAuta()
.clickMenuKategorieAuta()
.vyberKategorieAuta(vyberKategorie)
.clickNaTlacitkoHledej();
filtr
.filtrOvereniZnacky(znackaOvereni)
.filtrOvereniModelu(modelOvereni)
.filtrOvereniStari(stariOvereni)
.filtrOvereniCeny(cenaOvereni)
.filtrOvereniKategorie(kategorieOvereni);
});
});

View File

@ -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"
}

View File

@ -0,0 +1,47 @@
export class Filtrovani {
filtrOvereniZnacky(znackaOvereni) {
cy.get(
"#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(1) > span > span",
)
.contains(znackaOvereni)
.should("be.visible");
return this;
};
filtrOvereniModelu(modelOvereni) {
cy.get(
"#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(2) > span > span",
)
.contains(modelOvereni)
.should("be.visible");
return this;
};
filtrOvereniStari(stariOvereni) {
cy.get(
"#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(3) > span",
)
.contains(stariOvereni)
.should("be.visible");
return this;
};
filtrOvereniCeny(cenaOvereni) {
cy.get(
"#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(4) > span",
)
.contains(cenaOvereni)
.should("be.visible");
return this;
};
filtrOvereniKategorie(kategorieOvereni) {
cy.get(
"#modern2019-list > div.flex.flexSB.flexAlignCenter.mv5.noprint > ul > li:nth-child(5) > span > span",
)
.contains(kategorieOvereni)
.should("be.visible");
return this;
};
}

View File

@ -0,0 +1,173 @@
export class AaaAuto {
rozliseni() {
cy.viewport(1920, 1080);
return this;
};
hlavnistrana() {
cy.visit("https://www.aaaauto.cz/");
return this;
};
cookiespotvrzeni() {
cy.contains("Pouze nezbytné cookies").click();
return this;
};
hlavicka() {
// logo AAA
cy.get("#modern-header > header > div > div.headerMenu > a > svg").should(
"be.visible",
);
//Koupit
cy.get(
"#modern-header > header > div > div.headerMenu > ul > li:nth-child(1) > a",
)
.should("be.visible")
.trigger("mouseover");
// Prodat
cy.get(
"#modern-header > header > div > div.headerMenu > ul > li:nth-child(2) > a",
)
.should("be.visible")
.trigger("mouseover");
// Vyměnit
cy.get(
"#modern-header > header > div > div.headerMenu > ul > li:nth-child(3) > a",
)
.should("be.visible")
.trigger("mouseover");
// Financovat
cy.get(
"#modern-header > header > div > div.headerMenu > ul > li:nth-child(4) > a",
)
.should("be.visible")
.trigger("mouseover");
// Kariéra
cy.get(
"#modern-header > header > div > div.headerMenu > ul > li:nth-child(5) > a",
).should("be.visible");
// Ikona Lupy
cy.get(
"#modern-header > header > div > div.headerTools > span.headerToolsItem.searchButton > svg",
).should("be.visible");
// Kontakty otvírací doby
cy.get(
"#modern-header > header > div > div.headerTools > a:nth-child(2) > svg",
).should("be.visible");
// Garáž
cy.get("#notifications-desktop > span > svg")
.should("be.visible")
.trigger("mouseover");
// WhatsApp
cy.get(
"#modern-header > header > div > div.headerTools > a:nth-child(4) > svg > g > path:nth-child(4)",
).should("be.visible");
// Telefóní linka
cy.get(
"#modern-header > header > div > div.headerTools > span.headerToolsItem.headerToolsItemContact.hasSubmenu.submenuLink > h3",
)
.should("be.visible")
.trigger("mouseover");
return this;
};
slider() {
// api slidebar
cy.get("body > div.modern2018.fullHeight.fullWidth > div").should(
"be.visible",
);
return this;
};
filterbar() {
// Značka
cy.get("#hpFilterNG > form > div > div > div:nth-child(1)").should(
"be.visible",
);
// Model
cy.get("#hpFilterNG > form > div > div > div.select.disabled").should(
"be.visible",
);
// Rok
cy.get(
"#hpFilterNG > form > div > div > div.multiselect.multiselect--large",
).should("be.visible");
// Cena
cy.get("#hpFilterNG > form > div > div > div:nth-child(4)").should(
"be.visible",
);
// Kategorie
cy.get(
"#hpFilterNG > form > div > div > div.select.select--not-important",
).should("be.visible");
// Hledat
cy.get("#hpFilterNG > form > div > button").should("be.visible");
return this;
};
clickMenuZnacka() {
cy.get("#car_filter_make").click();
return this;
};
vyberZnacky(znackaVyber) {
cy.contains(znackaVyber).click();
return this;
};
clickMenuFiltrModelu() {
cy.get("#car_filter_model").click();
return this;
};
vyberModeluAuta(typModelu) {
cy.contains(typModelu).click();
return this;
};
clickMenuStariAuta() {
cy.get("#car_filter_yearMin-topForm").click();
return this;
};
vyberStariAuta(stariVyber) {
cy.contains(stariVyber).click();
return this;
};
potvrzeniStariAuta() {
cy.get("button[data-slider-filter-year-save]").click();
return this;
};
clickMenuCenyAuta() {
cy.get("#car_filter_priceMax-topForm").click();
return this;
};
vyberCenyAuta(vyberCeny) {
cy.contains(vyberCeny).click();
return this;
};
potvrzeniCenyAuta() {
cy.get("button[data-slider-filter-price-save]").click();
return this;
};
clickMenuKategorieAuta() {
cy.get("#car_filter_category").click();
return this;
};
vyberKategorieAuta(vyberKategorie) {
cy.contains(vyberKategorie).click();
return this;
};
clickNaTlacitkoHledej() {
cy.get('form[name="car_filter"]').submit();
return this;
}
};

View File

@ -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) => { ... })

View File

@ -0,0 +1,21 @@
// ***********************************************************
// This example support/e2e.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')
require("@cypress/xpath");

View File

@ -0,0 +1,7 @@
// cypress/support/index.js
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot');
require('@cypress/xpath');
addMatchImageSnapshotPlugin();