-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
describe('Kanban Board Task Movement Test', () => { | ||
beforeEach(() => { | ||
cy.visit('/') // Oletetaan, että sovellus on käynnissä tässä osoitteessa | ||
}) | ||
|
||
it('moves a task around the board and returns it to its original position', () => { | ||
// Taskin ja Columnin tunnistaminen tekstisisällön perusteella | ||
const taskContent = 'Task1' | ||
const originalColumnTitle = 'Column1' | ||
const destinationColumnTitle = 'Column2' | ||
|
||
// Alkuperäisen taskin sijainnin tallentaminen | ||
cy.contains(taskContent).closest('.column').as('originalColumn') | ||
|
||
// Varmista, että elementti on näkyvissä ja siirtää taskin ensimmäisestä sarakkeesta toiseen | ||
cy.contains(taskContent).scrollIntoView().as('taskToMove') | ||
|
||
// Simuloi "drag and drop" käyttämällä force: true ohittamaan elementin näkyvyyden tarkistuksen | ||
cy.get('@taskToMove').trigger('mousedown', { which: 1, force: true }) | ||
cy.contains(destinationColumnTitle) | ||
.scrollIntoView() | ||
.trigger('mousemove') | ||
.trigger('mouseup', { force: true }) | ||
|
||
// Tarkista, että taski on siirtynyt toiseen sarakkeeseen | ||
cy.contains(destinationColumnTitle).should('contain', taskContent) | ||
|
||
// Palauta taski alkuperäiseen sijaintiinsa | ||
cy.get('@taskToMove').trigger('mousedown', { which: 1, force: true }) | ||
cy.get('@originalColumn') | ||
.trigger('mousemove') | ||
.trigger('mouseup', { force: true }) | ||
|
||
// Tarkista, että taski on palannut alkuperäiseen Columniinsa | ||
cy.get('@originalColumn').should('contain', taskContent) | ||
|
||
// Varmista, että kaikki taskit ovat alkuperäisillä paikoillaan | ||
cy.contains(originalColumnTitle) | ||
.should('contain', 'Task1') | ||
.and('contain', 'Task2') | ||
cy.contains('Column2').should('contain', 'Task3') | ||
cy.contains('Column3').should('contain', 'Task4') | ||
cy.contains('Column4').should('contain', 'Task5') | ||
}) | ||
}) |
Binary file added
BIN
+285 KB
...es a task around the board and returns it to its original position (failed).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.