-
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. Create task without necessary arguments. #2685
Merged
bsekachev
merged 10 commits into
cvat-ai:develop
from
dvkruchinin:dkru/case-40-create-task-without-necessary-arguments
Jan 26, 2021
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
88754db
Add the test.
dvkruchinin ad76115
Add css classes.
dvkruchinin af426c3
Add cypress test. Try to create a task without necessary arguments.
dvkruchinin 7e569e7
Update copyright year
dvkruchinin d178248
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
dvkruchinin 76fa70e
Add step for deleting the task.
dvkruchinin d81e3aa
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
dvkruchinin c2308a1
Apply comments.
dvkruchinin 96bdc8e
Apply comments.
dvkruchinin 2985fe9
Merge branch 'develop' of https://github.com/openvinotoolkit/cvat int…
dvkruchinin 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
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
72 changes: 72 additions & 0 deletions
72
...ress/integration/actions_tasks_objects/case_40_create_task_without_necessary_arguments.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,72 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
context('Try to create a task without necessary arguments.', () => { | ||
const caseId = '40'; | ||
const labelName = `Case ${caseId}`; | ||
const taskName = `New annotation task for ${labelName}`; | ||
const imagesCount = 1; | ||
const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`; | ||
const width = 800; | ||
const height = 800; | ||
const posX = 10; | ||
const posY = 10; | ||
const color = 'gray'; | ||
const archiveName = `${imageFileName}.zip`; | ||
const archivePath = `cypress/fixtures/${archiveName}`; | ||
const imagesFolder = `cypress/fixtures/${imageFileName}`; | ||
const directoryToArchive = imagesFolder; | ||
|
||
before(() => { | ||
cy.visit('auth/login'); | ||
cy.login(); | ||
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount); | ||
cy.createZipArchive(directoryToArchive, archivePath); | ||
}); | ||
|
||
after(() => { | ||
cy.goToTaskList(); | ||
cy.getTaskID(taskName).then(($taskID) => { | ||
cy.deleteTask(taskName, $taskID); | ||
}); | ||
}); | ||
|
||
describe(`Testing "${labelName}"`, () => { | ||
it('Go to create task page.', () => { | ||
cy.get('#cvat-create-task-button').click(); | ||
}); | ||
|
||
it('Try to create a task without any fields. A task is not created.', () => { | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('exist'); | ||
cy.closeNotification('.cvat-notification-create-task-fail'); | ||
}); | ||
|
||
it('Input a task name. A task is not created.', () => { | ||
cy.get('[id="name"]').type(taskName); | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('exist'); | ||
cy.closeNotification('.cvat-notification-create-task-fail'); | ||
}); | ||
|
||
it('Input task labels. A task is not created.', () => { | ||
cy.addNewLabel(labelName); | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('exist'); | ||
cy.closeNotification('.cvat-notification-create-task-fail'); | ||
}); | ||
|
||
it('Add some files. A task created.', () => { | ||
cy.get('input[type="file"]').attachFile(archiveName, { subjectType: 'drag-n-drop' }); | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('not.exist'); | ||
cy.get('.cvat-notification-create-task-success').should('exist'); | ||
// Check that the interface is prepared for creating the next task. | ||
cy.get('[id="name"]').should('have.value', ''); | ||
cy.get('.cvat-constructor-viewer-item').should('not.exist'); | ||
}); | ||
}); | ||
}); |
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.
Should be a part of before
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.
Click to "Create new task" button moved to before.