Skip to content

Commit 2384810

Browse files
committed
add delay to each request in e2e test
1 parent 4dc44c8 commit 2384810

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cypress/integration/home.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/// <reference types="cypress" />
22

33
describe('Text Compare App', () => {
4+
const delay = 1000; // 1 second
5+
46
beforeEach(() => {
57
cy.visit('https://text-compare.netlify.app/');
8+
cy.wait(delay); // wait 1 second before running each test
69
});
710

811
it('should display the app name on the home page', () => {
@@ -23,8 +26,9 @@ describe('Text Compare App', () => {
2326
const left = 'Hello World';
2427
const right = 'Hello world';
2528

26-
cy.get('#editor1').clear().type(left);
27-
cy.get('#editor2').clear().type(right);
29+
cy.visit('#/');
30+
cy.get('#editor1').clear().type(left, { delay: 200 }); // 200ms between keystrokes
31+
cy.get('#editor2').clear().type(right, { delay: 200 });
2832

2933
cy.contains('button', 'Compare').click();
3034
cy.get('#diffeditor').should('be.visible');

0 commit comments

Comments
 (0)