Skip to content

Commit

Permalink
work for #4707 : update f-test & add a margin of error
Browse files Browse the repository at this point in the history
  • Loading branch information
Olga Larina committed Aug 15, 2022
1 parent 0643266 commit 6fa3e6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions testCafe/components/popup.ts
Expand Up @@ -146,9 +146,11 @@ frameworks.forEach(async framework => {
.expect(Selector(".sv-popup span").withText("modal_question").visible).ok();

const popupClientRect = await getElementClientRect(".sv-popup--modal .sv-popup__container");
const calcTop = Math.round((600 / 2 - popupClientRect.height / 2) * 10) / 10;
const calcLeft = Math.round((800 / 2 - popupClientRect.width / 2) * 10) / 10;
await t
.expect(popupClientRect.left).eql(Math.round((800 / 2 - popupClientRect.width / 2) * 10) / 10)
.expect(popupClientRect.top).eql(Math.round((600 / 2 - popupClientRect.height / 2) * 10) / 10)
.expect(Math.abs(popupClientRect.left - calcLeft)).lte(0.1)
.expect(Math.abs(popupClientRect.top - calcTop)).lte(0.1)

.click(clickButton)
.expect(popupModalSelector.visible).ok()
Expand Down

0 comments on commit 6fa3e6c

Please sign in to comment.