Skip to content

Commit 09f0bbb

Browse files
committed
fix(chrome): Scroll to 0,0 before taking screenshots in a crazy order
1 parent 4f27955 commit 09f0bbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/regression/generateRegressionTests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ while (matched = componentExtractor.exec(taggedForRegression)) {
2222
const regressionTest = async (t: TestContext, config: IConfig, component: string) => {
2323
const snappit = new Snappit(config);
2424
const driver = await snappit.start();
25-
2625
await util.go(driver, component);
26+
2727
for (const e of await driver.findElements(By.css(util.selectors.visreg))) {
2828
const sectionName = await e.getAttribute("data-visreg");
2929
t.log(` ${sectionName}:`);
3030
await util.snapshot(t, e);
3131
t.log(" ✔ DOM Snapshot");
32+
await driver.executeScript("window.scroll(0, 0);");
3233
await snappit.snap(`{browserName}/${sectionName}`, e as WebElement);
3334
t.log(" ✔ Image Snapshot");
3435
}

0 commit comments

Comments
 (0)