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(e2e): ✅ fix E2E tests #1269

Merged
merged 13 commits into from
Nov 15, 2023
Merged

chore(e2e): ✅ fix E2E tests #1269

merged 13 commits into from
Nov 15, 2023

Conversation

lloydrichards
Copy link
Collaborator

@lloydrichards lloydrichards commented Nov 14, 2023

Goals/Scope

There are a number of E2E tests that are failing, making it harder to judge if the dependabot can be safely merged in. From the latest github Actions there are 14 failing tests.

Description

Completed

  • add testID prop for the data-testid on ChartTypeButtons
  • should be possible to de-select options from color component in map
  • should be possible to only select table & map
  • should be possible to select ordinal measure as area color
  • it should display values in interactive filters as hierarchie
  • Segment sorting with hierarchy
  • Map legend preview table sorting
  • Sorting with values with same label as other values in the tree
  • tooltip content
  • Selecting SymbolLayer colors> should be possible to select geo dimension and see a legend
  • Filters initial state should have hierarchy dimensions first and topmost value selected

Skipped

  • Chart Snapshots map-nfi int ipad-mini, portrait
  • Chart Snapshots map-nfi int iphone-8, portrait
  • multi root hierarchy retrieval › should work for C-1029

Comments

This PR is to act as a benchmark so I can figure out overtime which E2E tests are still failing.

Copy link

vercel bot commented Nov 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2023 3:08pm

@Rdataflow
Copy link
Contributor

@bprusinowski for NFI cubes we need to rely on those published on PROD.
Chart Snapshots map-nfi int ipad-mini, portrait

you may ping @kronmar to learn how to update the charts...

@lloydrichards
Copy link
Collaborator Author

Selecting SymbolLayer colors > should be possible to select geo dimension and see a legend

The issue here seems to be that the datasets for the NFI chart config in map-nfi-chart-config.json can't be found. Any suggestions on how to fix this? Or should i skip/remove the E2E test?

Screenshot 2023-11-15 at 10 52 12

@lloydrichards
Copy link
Collaborator Author

multi root hierarchy retrieval > should work for C-1029
I'm not sure what exactly this test is suppost to be testing against, but the final error seems to be from GraphQL in regards to dimensions. @bprusinowski is this something that is still worth testing if fixed? or should this be skipped/removed?

Error: CombinedError: [GraphQL] Cannot find dimension [https://environment.ld.admin.ch/foen/nfi/unitOfReference](vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)
    at runTest (/Users/lloyd/Documents/GitHub/visualization-tool/e2e/query-hierarchies.spec.ts:104:11)
    at e2e/query-hierarchies.spec.ts:125:5

@bprusinowski
Copy link
Collaborator

@lloydrichards maybe it would make sense to change the config to base on PROD cubes, as suggested by @Rdataflow. I think you could make a new chart based on such cube, and copy the configurator state from DebugPanel / LocalStorage to the map-nfi-chart-config.json – the test might also then be slightly adjusted to match the new cube 👍

@lloydrichards
Copy link
Collaborator Author

it should display values in interactive filters as hierarchie
Something very odd is happenning here in regards to the slugs privided through the URL. I think the issues is with the await page.goto("/en/__test/int/bathing-water-quality-hierarchie"); either passing the slugs somehow or maybe to do with routing in general once the Show Filter button is clicked, but I would need some help to figure out where this might be causing issues.

Screenshot 2023-11-15 at 10 57 24

@bprusinowski
Copy link
Collaborator

bprusinowski commented Nov 15, 2023

For the multi-root hierarchies, I also think it might be more future-proof to switch to the PROD cube. But as the way of fetching hierarchies has changed in #1244, I would wait with adapting this one until the mentioned PR is merged 👀

@lloydrichards
Copy link
Collaborator Author

Filters > Filters initial state should have hierarchy dimensions first and topmost value selected
The issue here seems to be with the selector for the labels: const labels = filters.locator("label[for^=select-single-filter]"); looking at the the filters is seems there are different ways of applying the selector as well as the label that makes it not possible to select all at once. This is a legitimate bug that I think needs to be addressed, I'm not sure where changes were made to the filters, but if anyone has an idea on how these could be re-aligned, let me know.

Error: expect(received).toEqual(expected) // deep equality

Expected: "1. Region"
Received: "3. Grid"
    at e2e/filters.spec.ts:27:22

@bprusinowski
Copy link
Collaborator

For the it should display values in interactive filters as hierarchie, it looks that sometimes there's a problem with env and slug being undefined – but sometimes it works correctly. I assume we need to add a router.isReady condition and set env and slug only when router is loaded 👀

@kronmar
Copy link

kronmar commented Nov 15, 2023

For the multi-root hierarchies, I also think it might be more future-proof to switch to the PROD cube. But as the way of fetching hierarchies has changed in #1244, I would wait with adapting this one until the mentioned PR is merged 👀

Yes, just checked, Cube nfi_C-98 version 2023.1 is no longer on INT - my bad. If you don't mind switching to PROD would be better.

Copy link
Collaborator

@bprusinowski bprusinowski left a comment

Choose a reason for hiding this comment

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

💯

@lloydrichards lloydrichards merged commit 04695eb into main Nov 15, 2023
6 checks passed
@lloydrichards lloydrichards deleted the fix/e2e-tests branch November 15, 2023 20:04
@ptbrowne
Copy link
Collaborator

Thanks a lot @lloydrichards !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants