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

Fix screenshot tests #8289

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ process.on("unhandledRejection", (err, promise) => {
console.error("Unhandled rejection (promise: ", promise, ", reason: ", err, ").");
});
const BASE_PATH = path.join(__dirname, "../../../../frontend/javascripts/test/screenshots");
let URL = "https://master.webknossos.xyz";
let URL = "https://master.webknossos.xyz/";

if (!process.env.URL) {
console.warn(
Expand Down Expand Up @@ -114,7 +114,7 @@ test.before("Retrieve dataset ids", async () => {
3,
async () => {
const options = getDefaultRequestOptions(URL);
const url = `${URL}/api/datasets/disambiguate/sample_organization/${datasetName}/toId`;
const url = `${URL}api/datasets/disambiguate/sample_organization/${datasetName}/toId`;
Copy link
Member

Choose a reason for hiding this comment

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

the rest of the screenshot tests use urljoin to join url parts. that way, double slashes can also be avoided. I'd rather do this then relying on a trailing slash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I overlooked that. Thanks for the suggestion. It should be applied now.

I also did a quick test that requesting the URLs still works

const response = await fetch(url, options);
const { id } = await response.json();
datasetNameToId[datasetName] = id;
Expand All @@ -124,7 +124,7 @@ test.before("Retrieve dataset ids", async () => {
);
}
});
test("Dataset IDs were retrieved successfully", (t) => {
test.serial("Dataset IDs were retrieved successfully", (t) => {
for (const datasetName of datasetNames) {
t.truthy(datasetNameToId[datasetName], `Dataset ID not found for "${datasetName}"`);
}
Expand Down
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.
Binary file modified frontend/javascripts/test/screenshots/ROI2017_wkw_fallback.png
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.
Binary file modified frontend/javascripts/test/screenshots/dsA_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/javascripts/test/screenshots/float_test_dataset.png
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.