Skip to content

Instantly share code, notes, and snippets.

View slawekradzyminski's full-sized avatar

Slawek Radzyminski slawekradzyminski

View GitHub Profile
export const registerPageCss = {
title: 'h2',
registerButton: '.btn-primary',
fieldSelector: '.form-group',
errorMessage: '.invalid-feedback',
usernameField: '[name=username]',
firstNameField: '[name=firstName]',
lastNameField: '[name=lastName]',
passwordField: '[name=password]'
}
/// <reference types="cypress" />
context('Register tests', () => {
beforeEach(() => {
cy.visit('/register')
})
it('Should register', () => {
cy.get('[name=firstName]').type(getRandomString())
[
{
"id": 1,
"firstName": "Slawomir",
"lastName": "Radzyminski",
"username": "slawenty",
"password": "password"
},
{
"id": 2,
/// <reference types="cypress" />
context('Home page', () => {
beforeEach(() => {
cy.setTokenInLocalStorage()
cy.visit('/')
})
it('Should display at least one user', () => {
/// <reference types="cypress" />
import { homePageCss } from "../pages/homepage"
import { loginPageCss } from "../pages/loginpage"
import { registerPageCss } from "../pages/registerpage"
context('Login tests', () => {
const username = getRandomString()
const password = getRandomString()
/// <reference types="cypress" />
context('Login tests', () => {
beforeEach(() => {
cy.visit('/login')
})
it('Login page should be displayed', () => {
cy.get('h2').contains('Login')
/// <reference types="cypress" />
context('Home page full wypas', () => {
const username = getRandomString()
const password = getRandomString()
const firstName = getRandomString()
const lastName = getRandomString()
let userId
/// <reference types="cypress" />
context('Home page full wypas', () => {
const username = getRandomString()
const password = getRandomString()
const firstName = getRandomString()
const lastName = getRandomString()
let userId
/// <reference types="cypress" />
context('Home page full wypas', () => {
const username = getRandomString()
const password = getRandomString()
const firstName = getRandomString()
const lastName = getRandomString()
let userId
/// <reference types="cypress" />
context('Home page full wypas', () => {
const username = getRandomString()
const password = getRandomString()
const firstName = getRandomString()
const lastName = getRandomString()
before(() => {