Skip to content

Commit b749bed

Browse files
committed
chore: also fix tests, not only push the images
1 parent 3304010 commit b749bed

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

tests/specs/desktop.spec.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { ImageCompareResult } from '@wdio/image-comparison-core'
2-
import { join } from 'node:path'
32
import { browser, expect } from '@wdio/globals'
43
import { fileExists } from '../helpers/fileExists.ts'
54

@@ -45,22 +44,20 @@ describe('@wdio/visual-service desktop', () => {
4544

4645
it(`should not store an actual image for '${browserName}' when the diff is below the threshold (#1115)`, async function () {
4746
const tag = 'noActualStoredOnDiff'
48-
const baselineFolder = join(process.cwd(), '.tmp/1115-baseline')
4947

50-
await browser.saveScreen(tag, {
51-
actualFolder: baselineFolder,
52-
enableLayoutTesting: false,
48+
await browser.execute(() => {
49+
const el = document.createElement('div')
50+
el.id = 'test-diff-element'
51+
el.style.cssText = 'position:fixed;top:10px;left:10px;width:500px;height:500px;background:red;z-index:9999;'
52+
document.body.appendChild(el)
5353
})
5454

5555
const result = await browser.checkScreen(tag, {
56-
baselineFolder,
5756
returnAllCompareData: true,
58-
enableLayoutTesting: true,
5957
}) as ImageCompareResult
6058

6159
expect(result.misMatchPercentage).toBeGreaterThan(0)
62-
expect(result.misMatchPercentage).toBeLessThanOrEqual(50)
63-
60+
expect(result.misMatchPercentage).toBeLessThanOrEqual(70)
6461
expect(fileExists(result.folders.actual)).toBe(false)
6562
})
6663
})

0 commit comments

Comments
 (0)