-
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.
drafting a cypress test on issue #8785
- Loading branch information
Oleg Valiulin
committed
Dec 17, 2024
1 parent
c729f18
commit 3e0ab4d
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...ress/e2e/issues_prs2/issue_8785_Cannot_read_properties_of_undefined_reading_getUpdated.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,45 @@ | ||
// Copyright (C) 2024 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { taskName } from '../../support/const'; | ||
|
||
context('When saving after deleting a frame, job metadata is inconsistent.', () => { | ||
const issueId = '8785'; | ||
|
||
before(() => { | ||
cy.openTaskJob(taskName); | ||
cy.goToNextFrame(4); | ||
}); | ||
|
||
describe(`Testing issue ${issueId}`, () => { | ||
it('Crash on Save job. Save again.', () => { | ||
cy.deleteFrame(); // FIXME: does normal saving with 200, better to just push a button | ||
|
||
// Check that frame is deleted | ||
cy.contains('button', 'Restore').should('be.visible'); | ||
|
||
/** | ||
* FIXME: this just asserts 502 | ||
* | ||
* Here you have an example job endpoint response stubbing | ||
* Response is then intercepted and stubbed with 502 status code | ||
* | ||
* flow is like this: press a button directly + intercept | ||
* | ||
* Cypress works worse with double intercepts | ||
* Intercepting saveJob not gonna work | ||
* since it already does an intercept of the same request | ||
* | ||
* */ | ||
|
||
// Send bad PATCH | ||
cy.saveJob('PATCH', 502); | ||
|
||
// Send again | ||
cy.saveJob('PATCH', 200); | ||
}); | ||
}); | ||
}); |