Skip to content

Commit

Permalink
Reworked headlessCreateUser command in Cypress (#8977)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Jan 21, 2025
1 parent 4c5e522 commit c2bfb21
Show file tree
Hide file tree
Showing 65 changed files with 96 additions and 102 deletions.
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_objects/count_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ context('Count total annotation, issues and labels', () => {
const serverFiles = ['images/image_1.jpg'];

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.url().should('contain', '/tasks');
cy.headlessCreateTask({
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_objects/regression_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ context('Regression tests', () => {
};

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();

cy.headlessCreateTask(taskPayload, dataPayload).then((response) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ context('Backup, restore a project.', { browser: '!firefox' }, () => {
};

before(() => {
cy.visit('/');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, project.label, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ context('Creating a project by inserting labels from a task.', { browser: '!fire
const directoryToArchive = imagesFolder;

before(() => {
cy.visit('/');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, task.name, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ context('Tests source & target storage for backups.', () => {
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
createdCloudStorageId = cy.attachS3Bucket(cloudStorageData);
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ context('Move a task between projects.', () => {
imagesCount,
);
cy.createZipArchive(directoryToArchive, archivePath);
cy.visit('/');
cy.visit('/auth/login');
cy.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ context('Move a task to a project.', { browser: '!firefox' }, () => {
const directoryToArchive = imagesFolder;

before(() => {
cy.visit('/');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, task.name, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ context('Models page.', () => {
const caseId = '51';

before(() => {
cy.visit('/');
cy.visit('/auth/login');
cy.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ context('Basic markdown pipeline', () => {
let assetID = null;

before(() => {
cy.visit('/');
cy.headlessLogout();
cy.visit('/auth/login');
cy.get('.cvat-login-form-wrapper').should('exist').and('be.visible');

for (const user of Object.values(additionalUsers)) {
cy.headlessCreateUser(user);
cy.headlessLogout();
}

cy.login();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ context('Paste labels from one task to another.', { browser: '!firefox' }, () =>
const directoryToArchive = imagesFolder;

before(() => {
cy.visit('/');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, task.name, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ context('Delete a label from a task.', () => {
const directoryToArchive = imagesFolder;

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ context('Create a task with set an issue tracker.', () => {
const incorrectBugTrackerUrl = 'somebugtracker.info/task12';

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ context('Create an annotation task with manifest.', () => {
];

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ context('Rename a label via raw editor.', () => {
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ context('Hotkeys to change labels feature.', () => {
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_tasks/case_75_overlap_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ context('Overlap size.', () => {
const calculatedOverlapSize = advancedConfigurationParams.segmentSize - advancedConfigurationParams.overlapSize;

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ context('Import annotations for frames with dots in name.', { browser: '!firefox
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_tasks/navigate_specific_frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ context('Paste labels from one task to another.', { browser: '!firefox' }, () =>
const directoryToArchive = imagesFolder;

before(() => {
cy.visit('/');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, task.name, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ context('Task status updated after initial save.', () => {

before(() => {
cy.headlessLogout();
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.url().should('contain', '/tasks');
cy.headlessCreateTask({
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_tasks/task_rectangles_only.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ context('Creating a task with only bounding boxes', () => {
let taskID = null;

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(
imagesFolder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
const extension = 'jpg';

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
for (let i = 0; i < imagesCount; i++) {
cy.imageGenerator(imagesFolder, imageFileName + i, width, height, color, posX + i * 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ context('Settings. Text size/position. Text labels content.', () => {
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.get('.cvat-tasks-page').should('exist').and('be.visible');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ context('Try to create a task without necessary arguments.', () => {
const directoryToArchive = imagesFolder;

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ context('Add/delete labels and attributes.', () => {
const textDefaultValue = 'Some default value for type Text';

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.get('.cvat-create-task-dropdown').click();
cy.get('.cvat-create-task-button').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ context('Changing a label name via label constructor.', () => {
const secondLabelName = `Second case ${caseId}`;

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.get('.cvat-create-task-dropdown').click();
cy.get('.cvat-create-task-button').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ context('Export, import an annotation task.', { browser: '!firefox' }, () => {
};

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ context('Correct behaviour of fit when navigating between frames with different
let jobID = null;

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.url().should('contain', '/tasks');
cy.headlessCreateTask({
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_tasks3/case_105_cloud_storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ context('Cloud storage.', () => {
};

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ context('Connected file share.', () => {
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ context('Dummy cloud storages.', { browser: '!firefox' }, () => {
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_tasks3/case_112_tus_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ context('Create task with tus file', () => {
const extension = 'bmp';

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX,
posY, labelName, imagesCount, extension);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ context('Tests for source and target storage.', () => {
};

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
createdCloudStorageId = cy.attachS3Bucket(cloudStorageData);
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ context('Tests for source and target storage.', () => {
};

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
createdCloudStorageId = cy.attachS3Bucket(cloudStorageData);
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ context('Import and export annotations: specify source and target storage in mod
};

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
createdCloudStorageId = cy.attachS3Bucket(cloudStorageData);
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_tasks3/case_118_multi_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ context('Create mutli tasks.', () => {
}

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ context('Create and delete a annotation task. Color collision.', () => {
const newLabelName = 'adia';

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ context('Check if parameters "startFrame", "stopFrame", "frameStep" works as exp
};

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ context('Create a task with files from remote sources.', () => {
const correctUrl = wrongUrl.replace('cvatt.jpg', 'cvat.jpg');

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.get('.cvat-create-task-dropdown').click();
cy.get('.cvat-create-task-button').click();
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_tasks3/case_90_context_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ context('Context images for 2D tasks.', () => {
const pathToArchive = `../../${__dirname}/assets/case_90/case_90_context_image.zip`;

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, pathToArchive);
cy.openTaskJob(taskName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ context('Create task with special character in uploaded filename', () => {
const extension = 'bmp';

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX,
posY, labelName, imagesCount, extension);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ context('Reset password notification.', () => {
const dummyEmail = '[email protected]';

before(() => {
cy.visit('auth/login');
cy.visit('/auth/login');
});

describe(`Testing case "${caseId}"`, () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/actions_users/issue_1810_login_logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ context('When clicking on the Logout button, get the user session closed.', () =

before(() => {
cy.headlessLogout();
cy.visit('auth/login');
cy.visit('/auth/login');
});

describe(`Testing issue "${issueId}"`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ context('Some parts of the Redux state (issues) is not reset after changing a ta
before(() => {
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
cy.visit('/');
cy.visit('/auth/login');
cy.login();
cy.createAnnotationTask(taskName.firstTaskName, labelName, attrName, textDefaultValue, archiveName);
cy.goToTaskList();
Expand Down
Loading

0 comments on commit c2bfb21

Please sign in to comment.