Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: mac render tests #9175

Merged
merged 5 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion modules/test-utils/src/snapshot-test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type ImageDiffOptions = {
tolerance?: number; // 0.1,
includeAA?: boolean; // false,
includeEmpty?: boolean; // true
platform?: string;
};

type DiffImageResult = {
Expand Down Expand Up @@ -140,8 +141,20 @@ export class SnapshotTestRunner extends TestRunner<
};
// Take screenshot and compare
const result = await window.browserTestDriver_captureAndDiffScreen(diffOptions);

// If failed, try if we have a platform specific golden image
let resultOverride;
const platform = this.testOptions.imageDiffOptions?.platform?.toLowerCase();
if (!result.success) {
diffOptions.goldenImage = diffOptions.goldenImage.replace(
'golden-images/',
`golden-images/platform-overrides/${platform}/`
);
resultOverride = await window.browserTestDriver_captureAndDiffScreen(diffOptions);
}

// invoke user callback
if (result.success) {
if (result.success || resultOverride.success) {
this.pass(result);
} else {
this.fail(result);
Expand Down
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion test/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// THE SOFTWARE.
import test from 'tape';
import TEST_CASES from './test-cases';
import {WIDTH, HEIGHT} from './constants';
import {WIDTH, HEIGHT, OS} from './constants';
import {SnapshotTestRunner} from '@deck.gl/test-utils';

import './jupyter-widget';
Expand All @@ -40,6 +40,7 @@ test('Render Test', t => {
timeout: 10000,

imageDiffOptions: {
platform: OS,
threshold: 0.99,
includeEmpty: false
// uncomment to save screenshot to disk
Expand Down
Loading