-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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. Settings player step. #2539
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (C) 2020 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { taskName } from '../../support/const'; | ||
|
||
context('Settings "Player step"', () => { | ||
const caseId = '29'; | ||
const countJumpStep = 3; | ||
let startStep; | ||
|
||
function changePlayerStep() { | ||
cy.openSettings(); | ||
cy.get('.cvat-settings-modal').within(() => { | ||
cy.contains('Player').click(); | ||
cy.get('.cvat-player-settings-step').within(() => { | ||
cy.get('[role="spinbutton"]').clear().type(countJumpStep); | ||
}); | ||
}); | ||
cy.closeSettings(); | ||
}; | ||
|
||
before(() => { | ||
cy.openTaskJob(taskName); | ||
}); | ||
|
||
describe(`Testing case "${caseId}"`, () => { | ||
it('Change player step ', () => { | ||
changePlayerStep(); | ||
// get and save current step | ||
cy.get('.cvat-player-frame-selector').within(() => { | ||
cy.get('[role="spinbutton"]') | ||
.should('have.attr', 'aria-valuenow') | ||
.then((valueStepNow) => { | ||
startStep = Number(valueStepNow); | ||
}); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this code you get not a current step, you get initial frame. So, I would rename "startStep" to "initialFrame" or "startFrame" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. Variable renamed. |
||
}); | ||
|
||
it('Jump to forward frame via GUI', () => { | ||
cy.get('.cvat-player-forward-button').click(); | ||
cy.checkFrameNum(startStep + countJumpStep); | ||
}); | ||
|
||
it('Jump to backward frame via GUI', () => { | ||
cy.get('.cvat-player-backward-button').click(); | ||
cy.checkFrameNum(startStep); | ||
}); | ||
|
||
it('Jump to forward frame via shortcuts', () => { | ||
cy.get('body').type('{v}'); | ||
cy.checkFrameNum(startStep + countJumpStep); | ||
}); | ||
|
||
it('Jump to backward frame via shortcuts', () => { | ||
cy.get('body').type('{c}'); | ||
cy.checkFrameNum(startStep); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is reason to make a separated function here? The code is used only here as I can see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this function will be use in several steps. It changed now.