Merged
Conversation
* feat: cypress setup * feat: move cypress testing related files to e2e folder * fix: browser flag
* feat: implemented login logic for cypress tests * chore: updated environment configuration and documentation
…abled appropriately
feat: cypress tests for material data operations
* fix: sidebar tests * fix: logic for selecting correct calendar week
# Conflicts: # frontend/src/components/layout/SideBar.tsx # frontend/src/features/material-details/components/SummaryPanel.tsx
tom-rm-meyer-ISST
requested changes
May 25, 2025
Contributor
tom-rm-meyer-ISST
left a comment
There was a problem hiding this comment.
I tried to resolve conflicts and struggled with timeouts for the past few hours. Now just one issue remains with the sidebar tests.
Resolving Conflicts
Changes in SummaryPanel:
export function ReportedSummaryPanel<TType extends SummaryType>({ summary, materialNumber, site, partnerBpnl, ...props }: SummaryPanelProps<TType>) {
const { supplies, refreshSupply } = useReportedDaysOfSupply(materialNumber, summary.type === 'demand' ? DirectionType.Inbound : DirectionType.Outbound, site, partnerBpnl);
useEffect(() => {
refreshSupply()
}, [refreshSupply, summary])
return <SummaryPanelContent summary={summary} {...props} supplies={supplies ?? []} data-testid={`reported-summary-panel-${site ? site : partnerBpnl}`}/>
}Changes in SideBar.tsx "
{open ? <Stack gap="0.25rem" paddingInline=".5rem" paddingBlock="1rem" marginTop="auto" data-testid="sidebar-item-license">
<Typography
variant="body2"
component="h3"
fontWeight="600"
sx={{ maxWidth: '12rem', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}
>
{ownPartner?.name}
</Typography>
<Button variant="text" sx={{ padding: 0, justifyContent: 'start', width: 'fit-content'}} onClick={handleCopyBpnl}>
<Typography variant="body3">{ownPartner?.bpnl} <ContentCopyOutlined /></Typography>
</Button>
</Stack> : null}Issue Sidebar Test
Running into dom has changed error - using a callback runs to more often succeeding, but is still not reliable
cypress-e2e | sidebar
cypress-e2e | 1) shows 7 menu items and one is selected
cypress-e2e |
cypress-e2e |
cypress-e2e | 0 passing (1m)
cypress-e2e | 1 failing
cypress-e2e |
cypress-e2e | 1) sidebar
cypress-e2e | shows 7 menu items and one is selected:
cypress-e2e | CypressError: Timed out retrying after 60050ms: `cy.click()` failed because the page updated while this command was executing. Cypress tried to locate elements based on this query:
cypress-e2e |
cypress-e2e | > <a.MuiButtonBase-root.MuiListItemButton-root.MuiListItemButton-gutters.MuiListItemButton-root.MuiListItemButton-gutters.css-1oyxher>
cypress-e2e |
cypress-e2e | We initially found matching element(s), but while waiting for them to become actionable, they disappeared from the page. Common situations why this happens:
cypress-e2e | - Your JS framework re-rendered asynchronously
cypress-e2e | - Your app code reacted to an event firing and removed the element
cypress-e2e |
cypress-e2e | You can typically solve this by breaking up a chain. For example, rewrite:
cypress-e2e |
cypress-e2e | > `cy.get('button').click().click()`
cypress-e2e |
cypress-e2e | to
cypress-e2e |
cypress-e2e | > `cy.get('button').as('btn').click()`
cypress-e2e | > `cy.get('@btn').click()`
cypress-e2e |
cypress-e2e | https://on.cypress.io/element-has-detached-from-domI pushed the merged state, @ReneSchroederLJ could you check what I'm missing?
tom-rm-meyer-ISST
approved these changes
May 26, 2025
Contributor
tom-rm-meyer-ISST
left a comment
There was a problem hiding this comment.
Additionally now fixed the automation issue in #881
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: