Skip to content
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

Cypress test. Collapse sidebar. Fullscreen. #3302

Merged
Prev Previous commit
Next Next commit
The test adaptation
dvkruchinin committed Jun 8, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 5bfe4dbd980b97f546a1e18906b87b677545e680
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@

import { taskName, labelName } from '../../support/const';

context('Collapse sidebar. Fullscreen', () => {
// cypress-real-events API works only in Chrome browser
context('Collapse sidebar. Fullscreen', { browser: '!firefox' }, () => {
const caseId = '97';

const createRectangleShape2Points = {
@@ -26,28 +27,32 @@ context('Collapse sidebar. Fullscreen', () => {
});

describe(`Testing case "${caseId}"`, () => {
it('Collapse sidebar and activate fullscreen.', () => {
it('Collapse sidebar and activate fullscreen. "objects-sidebar-state-item" should be visible.', () => {
cy.get('#cvat_canvas_shape_1').should('not.have.class', 'cvat_canvas_shape_activated');
cy.window().then(window => {
// get site iframe for site, set the allowfullscreen to true
// get iframe, set the allowfullscreen to true
window.parent.document
.getElementsByClassName('aut-iframe')[0] // Cypress iframe class name
.setAttribute('allowFullScreen', 'true');
});
cy.reload();
// make sure fullscreen is now enabled
cy.document().its('fullscreenEnabled').should('be.true');
// cy.closeModalUnsupportedPlatform();
cy.contains('.cvat-annotation-header-button', 'Fullscreen').trigger('mousedown', {button: 0});
cy.contains('.cvat-annotation-header-button', 'Fullscreen').trigger('mouseup');
// hide

// hide sidebar
cy.get('.cvat-objects-sidebar-sider').click();
cy.get('.cvat-objects-sidebar').should('not.be.visible');

// unhide
cy.contains('.cvat-annotation-header-button', 'Fullscreen').click();

cy.contains('.cvat-annotation-header-button', 'Fullscreen').realClick(); // Enable fuulscreen

// unhide sidebar
cy.get('.cvat-objects-sidebar-sider').click();
cy.get('.cvat-objects-sidebar').should('be.visible');

cy.contains('.cvat-annotation-header-button', 'Fullscreen').realClick(); // Disable fuulscreen

// Before the fix the sidebar item did not appear accordingly it was not possible to activate the shape through the sidebar item
cy.get(`#cvat-objects-sidebar-state-item-1`).trigger('mouseover');
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated');
});