-
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 for issue 1870 #2016
Merged
bsekachev
merged 2 commits into
cvat-ai:develop
from
dvkruchinin:dkru/cypress_test_issue_1870
Aug 12, 2020
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (C) 2020 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
context('Checks that the cursor doesn\'t automatically jump to the end of a word when the attribute value changes', () => { | ||
|
||
const issueId='1870' | ||
const labelName=`Issue ${issueId}` | ||
const taskName=`New annotation task for ${labelName}` | ||
const attrName=`Attr for ${labelName}` | ||
const textDefaultValue='text' | ||
const image=`image_${issueId}.png` | ||
const newLabelAttrValue = 'teeext' | ||
const width='800' | ||
const height='800' | ||
const posX=10 | ||
const posY=10 | ||
const color='gray' | ||
|
||
before(() => { | ||
cy.visit('auth/login') | ||
cy.login() | ||
cy.get('[type="submit"]').click() | ||
cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) | ||
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) | ||
}) | ||
|
||
describe(`Open task "${taskName}"`, () => { | ||
it('The annotation task present in the list', () => { | ||
cy.contains('strong', taskName) | ||
.parent() | ||
.parent() | ||
.parent() | ||
.contains('a', 'Open').click() | ||
}) | ||
it('Open a job', () => { | ||
cy.contains('a', 'Job #').click() | ||
cy.url().should('include', '/jobs') | ||
}) | ||
it('Create a shape', () => { | ||
cy.createShape(309, 431, 616, 671) | ||
}) | ||
it('Check what cursor doesn\'t automatically jumps at the end of the word', () => { | ||
cy.get('.ant-row > .ant-collapse > .ant-collapse-item > .ant-collapse-header > span') | ||
.should('contain', 'Details') | ||
.click() | ||
cy.get('.ant-input') | ||
.type('{leftarrow}{leftarrow}ee') | ||
cy.get('.ant-input') | ||
.should('have.value', newLabelAttrValue) | ||
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. Can we unite it to the same chain without extra 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. Yes, we can. I've reworked this part of the code a bit. |
||
}) | ||
}) | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not really reliable selector. It is better to use an identificator before. Here can be a lot of collapses in the future.
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 tried to shorten selector.