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

allow filtering on pass/fail and browser #57

Merged
merged 2 commits into from
Jul 7, 2023
Merged

Conversation

dlockhart
Copy link
Member

@dlockhart dlockhart commented Jul 6, 2023

Introduces a fixed sidebar that contains filters for "status" and "browser". Still just basic styling, but starting to add a bit of colour!

Screenshot 2023-07-06 at 5 45 20 PM

@dlockhart dlockhart requested a review from a team as a code owner July 6, 2023 21:46
position: sticky;
top: 0;
z-index: 10;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stole most of these styles from the Daylight Site. They work for now and we can tweak them later!

`];
constructor() {
super();
this._filterBrowsers = data.browsers.map(b => b.name);
this._filterStatus = data.numFailed > 0 ? FILTER_STATUS.FAILED : FILTER_STATUS.ALL;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to showing only failed tests, assuming there are any.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a bug Stacey noticed where the images always grow to fill the viewport. Now they'll fill the viewport but not exceed the actual size of the screenshots.

@@ -52,7 +63,6 @@ function flattenResults(session, browserData, fileData) {
const testData = fileData.tests.get(testName);
if (!t.passed) {
browserData.numFailed++;
fileData.numFailed++;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Counting it here caused it to think that a test failed 3 times if it failed in all 3 browsers, which isn't quite what I want to surface.

Copy link
Contributor

@svanherk svanherk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great!

src/server/report/app.js Outdated Show resolved Hide resolved
Co-authored-by: Stacey Van Herk <[email protected]>
@dlockhart dlockhart merged commit 189e5f6 into main Jul 7, 2023
1 check passed
@dlockhart dlockhart deleted the dlockhart/filtering branch July 7, 2023 16:19
@ghost
Copy link

ghost commented Jul 7, 2023

🎉 This PR is included in version 0.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants