From fc9e3eb2a618ab6dbab57a66af2e35e53b0bd15b Mon Sep 17 00:00:00 2001 From: zaha Date: Fri, 31 May 2024 13:40:57 +0300 Subject: [PATCH] check non-existent cloud storage update page --- tests/cypress/e2e/features/cloudstorages.js | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cypress/e2e/features/cloudstorages.js diff --git a/tests/cypress/e2e/features/cloudstorages.js b/tests/cypress/e2e/features/cloudstorages.js new file mode 100644 index 00000000000..0e3a000f355 --- /dev/null +++ b/tests/cypress/e2e/features/cloudstorages.js @@ -0,0 +1,29 @@ +// Copyright (C) 2023-2024 CVAT.ai Corporation +// +// SPDX-License-Identifier: MIT + +/// + +context('Cloudstorages', () => { + before(() => { + cy.visit('auth/login'); + cy.login(); + cy.visit('/cloudstorages'); + }); + + const nonExistCloudstorageId = 99; + + describe('Cloudstorage page', () => { + it('Verify that attempting to update a non-existent cloud storage displays an error message', () => { + cy.intercept({ + method: 'GET', + url: `/api/cloudstorages/${nonExistCloudstorageId}`, + }).as('cloudstorageRequest'); + + cy.visit(`/cloudstorages/update/${nonExistCloudstorageId}`); + cy.wait('@cloudstorageRequest').its('response.statusCode').should('eq', 404); + cy.get('.cvat-spinner').should('not.exist'); + cy.contains('Sorry, but the requested cloud storage was not found'); + }); + }); +});