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

Pc 686 e2e nieuws werkinstructies #985

Merged
merged 122 commits into from
Jan 29, 2025
Merged

Conversation

felixcicatt
Copy link
Contributor

No description provided.

@felixcicatt felixcicatt force-pushed the PC-686-e2e-nieuws-werkinstructies branch from 1fcf77f to 9247d0e Compare December 19, 2024 14:33
@felixcicatt felixcicatt force-pushed the PC-686-e2e-nieuws-werkinstructies branch from 4ec1be2 to 915b3fb Compare December 23, 2024 14:32
henokicatt and others added 21 commits January 22, 2025 15:45
Refactored Bericht class in CreateBericht.cs from a record to a regular class and using UpdateAsync method
Reformatted and restructured CreateBericht.cs for better readability and consistency.
Renamed `CreateBerichtExtension` to `ManageBerichtExtension`.
Renamed `CreateBericht` to `CreateBerichtAsync` for async clarity.
Updated `CreateBerichten` to call `CreateBerichtAsync`.
Added `UpdateBerichtAsync` for updating `Bericht` objects.
Modified `Bericht` class: added `Key` property, made `Title` required,
marked several properties as `new`, and updated `DisposeAsync` to filter
by `BerichtType` and `Title`. Removed `UpdateAsync` method, merged its
functionality into `UpdateBerichtAsync`. Ensured `DisposeAsync` sets
`Key` to `Title` after updating.

Updated test scenarios to use async methods, improving efficiency and
consistency. Simplified deletion steps in `Scenario19`.
…cenario-24-25-26

Pc-686 End to end tests scenario 24 25 26
Updated NieuwsEnWerkInstructiesScenarios.cs to replace CreateBericht with CreateBerichtAsync in Scenario27, Scenario28, and Scenario30. This change enhances performance and better handles asynchronous operations.
Renamed `CreateBerichtExtension` to `ManageBerichtExtension`. Updated `CreateBericht` to `CreateBerichtAsync` for async conventions. Replaced `OnSaveBericht` with `UpdateBerichtAsync`. Converted `Bericht` from a record to a class with additional properties and methods. Added a constructor to `Bericht` to initialize `_page`. Updated `DisposeAsync` to use `_page` and added detailed filtering logic. Set `Key` property in `CreateBerichtAsync` and added update logic in `UpdateBerichtAsync`. Updated test scenarios to use async methods and adjusted namespace imports and variable names for consistency.
Replaced CreateBericht with CreateBerichtAsync in multiple test methods within the NieuwsEnWerkInstructiesScenarios class. This change affects Scenario31, Scenario32, Scenario33, and other scenarios involving the creation of news items and work instructions. The update ensures asynchronous handling, improving performance and responsiveness.
Added GetAllLinksFromNavAsync in Locators.cs to retrieve all <a> tags within a <nav> element. Introduced FindBerichtOnPagesAsync in ManageBericht.cs to search for specific text across multiple pages with optional URL filtering. Updated NieuwsEnWerkInstructiesScenarios.cs to navigate to a specific section, browse all pages, and verify the absence of a news item using the new method. Included System namespace in ManageBericht.cs.
Added GetAllLinksFromNavAsync in Locators.cs to retrieve all link elements within a <nav> element. Introduced FindBerichtOnPagesAsync in ManageBericht.cs to search for specific "bericht" across multiple pages. Updated NieuwsEnWerkInstructiesScenarios.cs to use FindBerichtOnPagesAsync for verifying "nieuws" items. Replaced direct navigation to home page with Page.NavigateToNieuwsWerkinstructiesBeheer. Removed GetNieuwsSection().GetByRole(AriaRole.Article) and replaced with assertions using FindBerichtOnPagesAsync. Added necessary using directives in ManageBericht.cs.
Replaced `GetByText` with `GetBeheerRowByValue` for locating elements by `searchString`. This change improves the accuracy of element identification on the web page.
Removed FindBerichtOnPagesAsync from ManageBericht.cs. Updated NieuwsEnWerkInstructiesScenarios.cs to navigate directly to the home page. Added manual iteration through Nieuws section pages by clicking "Next Page" and checking for nieuwsbericht visibility. Updated assertion to reflect new nieuwsbericht existence check method.
Removed FindBerichtOnPagesAsync from ManageBericht.cs.
Replaced NavigateToNieuwsWerkinstructiesBeheer with GotoAsync("/").
Updated logic to manually navigate and check for nieuws items.
Iterate through pages using nextPageButton until disabled.
Check visibility of nieuws item by title on each page.
Updated assertions to reflect new navigation and search logic.
The code within the `while` loop that waits for the `nieuwsSection.First` element to be visible has been removed. The loop now ends after checking if the `nieuwsSection` contains the specified `niewus.Title`. A new step has been added after the loop to assert that the `nieuwsbericht` should not be visible. The assertion `Assert.AreEqual(false, niewsExists);` has been added to verify that `niewsExists` is `false`.

These changes improve the efficiency of the test by removing redundant waits and directly asserting the expected outcome.
Introduce IsBerichtVisibleOnAllPagesAsync in ManageBericht.cs to encapsulate the logic for checking the visibility of a Bericht across multiple pages within a section. Refactor NieuwsEnWerkInstructiesScenarios.cs to use this new method, simplifying the test code by removing manual page navigation and visibility checks.
Updated ManageBericht.cs with GetBerichtOnAllPagesAsync and AreSkillsVisibleByNameAsync methods. Refactored NieuwsEnWerkInstructiesScenarios.cs to use these new methods, improving navigation and visibility checks for Nieuws and Werkinstructies articles. Enhanced code readability and maintainability by updating assertions to use the new methods.
…cenario-27-28-30

pc-686 end-to-end test scenarios 27, 28, 30
@KISSAdmin
Copy link
Contributor

KISSAdmin commented Jan 27, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

mstokericatt and others added 2 commits January 28, 2025 14:11
…2e-31-32-33-34-35

PC-686 end to end test scenario 31-32-33-34-35
@felixcicatt felixcicatt marked this pull request as ready for review January 28, 2025 15:18
henokicatt and others added 3 commits January 29, 2025 16:19
- Added `WaitForPageAndSpinnerAsync` calls in `ManageBericht.cs` to ensure complete page load before interactions.
- Refactored to store `Rich Text Editor` element in a variable before filling it in `ManageBericht.cs`.
- Introduced `WaitForPageAndSpinnerAsync` method in `ManageBericht.cs` for centralized page and spinner wait logic.
- Updated `NieuwsEnWerkInstructiesScenarios.cs` to use `nieuws.PublicatieDatum` for publication date expectation, enhancing test accuracy.
…C-686-e2e-nieuws-werkinstructies

PC-686 Hotfix Improve page load handling and test accuracy
@mstokericatt mstokericatt merged commit b179b49 into main Jan 29, 2025
7 checks passed
@mstokericatt mstokericatt deleted the PC-686-e2e-nieuws-werkinstructies branch January 29, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants