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

fix create const task iff not exists #8988

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tests/cypress/support/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ export const multiAttrParams = {
type: 'Text',
};

it('Prepare to testing', () => {
it('Prepare for testing', () => {
cy.visit('/auth/login');
cy.login();
cy.get('.cvat-tasks-page').should('exist');
const listItems = [];
cy.document().then((doc) => {
const collection = Array.from(doc.querySelectorAll('.cvat-item-task-name'));
for (let i = 0; i < collection.length; i++) {
listItems.push(collection[i].innerText);
}
cy.document().find('.cvat-item-task-name').each(($el) => {
cy.wrap($el).invoke('text').then((text) => {
listItems.push(text);
});
}); // NOTE: chaining off of .each is not recommended by docs
cy.then(() => {
if (listItems.indexOf(taskName) === -1) {
cy.task('log', "A task doesn't exist. Creating.");
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
Expand Down
Loading