Cypress test for issue 810 (#2045)

Co-authored-by: Dmitry Kruchinin <dmitryx.kruchinin@intel.com>
main
Dmitry Kruchinin 6 years ago committed by GitHub
parent 82c3e0496b
commit 4dadf55344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,6 +4,10 @@
"viewportWidth": 1300,
"viewportHeight": 960,
"defaultCommandTimeout": 10000,
"env": {
"user": "admin",
"password": "12qwaszx"
},
"testFiles": [
"auth_page.js",
"issue_*.js"

@ -0,0 +1,27 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
/// <reference types="cypress" />
context('When clicking on the Logout button, get the user session closed.', () => {
const issueId = '1810'
before(() => {
cy.visit('auth/login')
})
describe(`Testing issue "${issueId}"`, () => {
it('Login', () => {
cy.login()
cy.url().should('include', '/tasks')
})
it('Logout', () => {
cy.logout()
cy.url().should('include', '/auth/login')
})
})
})

@ -10,12 +10,21 @@ require('cypress-file-upload')
require('../plugins/imageGenerator/imageGeneratorCommand')
require('../plugins/createZipArchive/createZipArchiveCommand')
Cypress.Commands.add('login', (username='admin', password='12qwaszx') => {
Cypress.Commands.add('login', (username=Cypress.env('user'), password=Cypress.env('password')) => {
cy.get('[placeholder="Username"]').type(username)
cy.get('[placeholder="Password"]').type(password)
cy.get('[type="submit"]').click()
})
Cypress.Commands.add('logout', (username=Cypress.env('user')) => {
cy.get('.cvat-right-header')
.find('.cvat-header-menu-dropdown')
.should('have.text', username)
.trigger('mouseover', {which: 1})
cy.get('.anticon-logout')
.click()
})
Cypress.Commands.add('createAnnotationTask', (taksName='New annotation task',
labelName='Some label',
attrName='Some attr name',

Loading…
Cancel
Save