-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cypress test. Create a task with manifest file. (#3014)
* Update cypress configs * Add manifest as an asset * Cypress test. Create a task with manifest file. * Rework assets * Update cypress test * Add check container existing
- Loading branch information
1 parent
1f56fd2
commit 70a9071
Showing
6 changed files
with
59 additions
and
8 deletions.
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
Binary file added
BIN
+11.1 KB
...s/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.5 KB
...s/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/manifest.jsonl
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,4 @@ | ||
{"version":"1.0"} | ||
{"type":"images"} | ||
{"name":"image_case_65_1","extension":".png","width":800,"height":800,"checksum":"82d6b0b6e0dfb3c63ac49880c3756b1a"} | ||
{"name":"image_case_65_2","extension":".png","width":800,"height":800,"checksum":"20ab1351cfad5bbbca009ac4c6522ede"} |
47 changes: 47 additions & 0 deletions
47
tests/cypress/integration/actions_tasks_objects/case_65_create_task_with_manifest.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,47 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
context('Create an annotation task with manifest.', () => { | ||
const caseId = '65'; | ||
const labelName = `Case ${caseId}`; | ||
const taskName = `New annotation task for ${labelName}`; | ||
const attrName = `Attr for ${labelName}`; | ||
const textDefaultValue = 'Some default value for type Text'; | ||
const pathToFiles = `${__dirname}/assets/case_65_manifest`; | ||
let filesToAttache = []; | ||
|
||
before(() => { | ||
cy.visit('auth/login'); | ||
cy.login(); | ||
}); | ||
|
||
describe(`Testing "${labelName}"`, () => { | ||
it('Task created successfully.', () => { | ||
cy.task('listFiles', pathToFiles).then(($files) => { | ||
$files.forEach(($el) => { | ||
// Add the path relative to the fixtures folder to the file names for the plugin "cypress-file-upload" to work correctly | ||
filesToAttache.push(`../../${pathToFiles}/${$el}`); | ||
}); | ||
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, filesToAttache); | ||
}); | ||
cy.get('.cvat-notification-create-task-success').should('exist'); | ||
cy.get('.cvat-notification-create-task-fail').should('not.exist'); | ||
}); | ||
|
||
it('The task and a job opened successfully.', () => { | ||
cy.openTaskJob(taskName); | ||
}); | ||
|
||
it('Moving through frames works correctly.', () => { | ||
cy.checkFrameNum(0); | ||
cy.get('.cvat-player-filename-wrapper').should('have.text', 'image_case_65_1.png'); | ||
cy.get('.cvat-player-next-button').click(); | ||
cy.get('.cvat-canvas-container').should('exist'); | ||
cy.checkFrameNum(1); | ||
cy.get('.cvat-player-filename-wrapper').should('have.text', 'image_case_65_2.png'); | ||
}); | ||
}); | ||
}); |
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