Skip to content

Commit dd5b273

Browse files
committed
Revert "test(ObjectPage): fix test in CI"
This reverts commit de799d0.
1 parent cc7b013 commit dd5b273

File tree

3 files changed

+137
-133
lines changed

3 files changed

+137
-133
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ jobs:
1515
strategy:
1616
matrix:
1717
spec:
18-
- main/src/components/ObjectPage
18+
- base
19+
- charts
20+
- cypress-commands
21+
- main/src/components
22+
- main/src/webComponents
23+
- main/src/internal
24+
- compat
1925
react: ['18', '19']
2026
fail-fast: false
2127
steps:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build:storybook-sitemap": "node ./scripts/create-storybook-sitemap.js --directory .out",
1616
"test:prepare": "rimraf temp && lerna run build",
1717
"test:open": "CYPRESS_COVERAGE=false cypress open --component --browser chrome",
18-
"test": "yarn test:prepare && cypress run --component --browser chrome --spec packages/main/src/components/ObjectPage",
18+
"test": "yarn test:prepare && cypress run --component --browser chrome --spec packages",
1919
"clean": "tsc --build --clean && tsc --build tsconfig.build.json --clean && rimraf temp .out && lerna run clean",
2020
"clean:remove-modules": "yarn clean && rimraf node_modules",
2121
"prettier:all": "prettier --write --config ./prettier.config.js \"**/*\"",

packages/main/src/components/ObjectPage/ObjectPage.cy.tsx

Lines changed: 129 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -365,154 +365,152 @@ describe('ObjectPage', () => {
365365
});
366366
});
367367

368-
for (let i = 0; i < 10; i++) {
369-
it.only('scroll to sections - default mode', () => {
370-
document.body.style.margin = '0px';
371-
cy.mount(
372-
<ObjectPage data-testid="op" titleArea={DPTitle} headerArea={DPContent} style={{ height: '100vh' }}>
373-
{OPContent}
374-
</ObjectPage>,
375-
);
376-
cy.wait(200);
368+
it('scroll to sections - default mode', () => {
369+
document.body.style.margin = '0px';
370+
cy.mount(
371+
<ObjectPage data-testid="op" titleArea={DPTitle} headerArea={DPContent} style={{ height: '100vh' }}>
372+
{OPContent}
373+
</ObjectPage>,
374+
);
375+
cy.wait(200);
377376

378-
// first titleText should never be displayed (not.be.visible doesn't work here - only invisible for sighted users)
379-
cy.findByText('Goals')
380-
.parent()
381-
.should('have.css', 'width', '1px')
382-
.and('have.css', 'margin', '-1px')
383-
.and('have.css', 'position', 'absolute');
384-
cy.findByText('Employment').should('not.be.visible');
385-
cy.findByText('Test').should('be.visible');
377+
// first titleText should never be displayed (not.be.visible doesn't work here - only invisible for sighted users)
378+
cy.findByText('Goals')
379+
.parent()
380+
.should('have.css', 'width', '1px')
381+
.and('have.css', 'margin', '-1px')
382+
.and('have.css', 'position', 'absolute');
383+
cy.findByText('Employment').should('not.be.visible');
384+
cy.findByText('Test').should('be.visible');
386385

387-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').realClick();
388-
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected', 300);
389-
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected', 300);
390-
cy.get(`[ui5-tab][data-index="3"]`).should('have.attr', 'selected');
391-
cy.findByText('Employment').should('be.visible');
386+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').realClick();
387+
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected', 300);
388+
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected', 300);
389+
cy.get(`[ui5-tab][data-index="3"]`).should('have.attr', 'selected');
390+
cy.findByText('Employment').should('be.visible');
392391

393-
cy.wait(200);
392+
cy.wait(200);
394393

395-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').realClick();
396-
cy.findByText('Test').should('be.visible');
394+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').realClick();
395+
cy.findByText('Test').should('be.visible');
397396

398-
// no scroll when focusing something in the header area
399-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').realClick();
400-
cy.findByText('Job Information').should('be.visible');
401-
cy.findByTestId('op').invoke('scrollTop').as('scrollTop');
402-
cy.wait(100);
403-
cy.realPress('ArrowLeft');
404-
cy.get('@scrollTop').then((scrollTop) => {
405-
cy.findByTestId('op').invoke('scrollTop').should('equal', scrollTop);
406-
});
397+
// no scroll when focusing something in the header area
398+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').realClick();
399+
cy.findByText('Job Information').should('be.visible');
400+
cy.findByTestId('op').invoke('scrollTop').as('scrollTop');
401+
cy.wait(100);
402+
cy.realPress('ArrowLeft');
403+
cy.get('@scrollTop').then((scrollTop) => {
404+
cy.findByTestId('op').invoke('scrollTop').should('equal', scrollTop);
405+
});
407406

408-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').focus();
409-
cy.realPress('ArrowDown');
410-
cy.realPress('ArrowDown');
411-
cy.realPress('ArrowDown');
412-
cy.realPress('Enter');
413-
cy.get('[data-section-id="goals"]').shouldNeverHaveAttribute('selected');
414-
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected');
415-
cy.findByText('Job Relationship').should('be.visible');
407+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').focus();
408+
cy.realPress('ArrowDown');
409+
cy.realPress('ArrowDown');
410+
cy.realPress('ArrowDown');
411+
cy.realPress('Enter');
412+
cy.get('[data-section-id="goals"]').shouldNeverHaveAttribute('selected');
413+
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected');
414+
cy.findByText('Job Relationship').should('be.visible');
416415

417-
cy.mount(
418-
<ObjectPage
419-
data-testid
420-
titleArea={DPTitle}
421-
headerArea={DPContent}
422-
footerArea={Footer}
423-
style={{ height: '100vh' }}
424-
>
425-
{OPContent}
426-
</ObjectPage>,
427-
);
428-
cy.wait(100);
416+
cy.mount(
417+
<ObjectPage
418+
data-testid
419+
titleArea={DPTitle}
420+
headerArea={DPContent}
421+
footerArea={Footer}
422+
style={{ height: '100vh' }}
423+
>
424+
{OPContent}
425+
</ObjectPage>,
426+
);
427+
cy.wait(100);
429428

430-
cy.findByText('Employment').should('not.be.visible');
431-
cy.findByText('Test').should('be.visible');
432-
cy.findByTestId('footer').should('be.visible');
429+
cy.findByText('Employment').should('not.be.visible');
430+
cy.findByText('Test').should('be.visible');
431+
cy.findByTestId('footer').should('be.visible');
433432

434-
// Select Employment tab
435-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').focus();
436-
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
437-
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
438-
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
439-
cy.get('[ui5-tabcontainer]').realPress('Enter');
433+
// Select Employment tab
434+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').focus();
435+
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
436+
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
437+
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
438+
cy.get('[ui5-tabcontainer]').realPress('Enter');
440439

441-
cy.wait(200);
442-
//fallback click
443-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').realClick();
444-
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected', 500);
445-
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected', 500);
446-
cy.findByTestId('footer').should('be.visible');
447-
cy.findByText('Employment').should('be.visible');
448-
cy.findByText('Job Information').should('be.visible');
440+
cy.wait(200);
441+
//fallback click
442+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').realClick();
443+
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected', 500);
444+
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected', 500);
445+
cy.findByTestId('footer').should('be.visible');
446+
cy.findByText('Employment').should('be.visible');
447+
cy.findByText('Job Information').should('be.visible');
449448

450-
cy.wait(200);
449+
cy.wait(200);
451450

452-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').click();
453-
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected', 300);
454-
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected', 300);
455-
cy.findByText('Test').should('be.visible');
456-
cy.findByTestId('footer').should('be.visible');
451+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').click();
452+
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected', 300);
453+
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected', 300);
454+
cy.findByText('Test').should('be.visible');
455+
cy.findByTestId('footer').should('be.visible');
457456

458-
cy.wait(300);
457+
cy.wait(300);
459458

460-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').focus();
461-
cy.realPress('ArrowDown');
462-
cy.wait(500);
463-
cy.realPress('ArrowDown');
464-
cy.realPress('ArrowDown');
465-
cy.realPress('Enter');
466-
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected');
467-
cy.get(`[ui5-tab][data-index="3"]`).should('have.attr', 'selected');
468-
// wait for scroll
469-
cy.wait(200);
470-
cy.findByText('Job Relationship').should('be.visible');
459+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Employment').focus();
460+
cy.realPress('ArrowDown');
461+
cy.wait(500);
462+
cy.realPress('ArrowDown');
463+
cy.realPress('ArrowDown');
464+
cy.realPress('Enter');
465+
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected');
466+
cy.get(`[ui5-tab][data-index="3"]`).should('have.attr', 'selected');
467+
// wait for scroll
468+
cy.wait(200);
469+
cy.findByText('Job Relationship').should('be.visible');
471470

472-
cy.findByTestId('footer').should('be.visible');
471+
cy.findByTestId('footer').should('be.visible');
473472

474-
cy.mount(
475-
<ObjectPage
476-
data-testid
477-
titleArea={DPTitle}
478-
headerArea={DPContent}
479-
footerArea={Footer}
480-
style={{ height: '100vh' }}
481-
>
482-
{OPContent}
483-
<ObjectPageSection aria-label="Long Section" id="long-section" titleText="Long Section">
484-
<ObjectPageSubSection aria-label="Long Subsection 1" id="sub1" titleText="Long Subsection 1">
485-
<FlexBox style={{ height: '2000px' }} direction="Column" justifyContent="SpaceBetween">
486-
<span>Start SubSection1</span>
487-
<span>End SubSection1</span>
488-
</FlexBox>
489-
</ObjectPageSubSection>
490-
<ObjectPageSubSection aria-label="Long Subsection 2" id="sub2" titleText="Long Subsection 2">
491-
<FlexBox style={{ height: '1000px' }} direction="Column" justifyContent="SpaceBetween">
492-
<span>Start SubSection2</span>
493-
<span>End SubSection2</span>
494-
</FlexBox>
495-
</ObjectPageSubSection>
496-
</ObjectPageSection>
497-
</ObjectPage>,
498-
);
499-
cy.wait(100);
473+
cy.mount(
474+
<ObjectPage
475+
data-testid
476+
titleArea={DPTitle}
477+
headerArea={DPContent}
478+
footerArea={Footer}
479+
style={{ height: '100vh' }}
480+
>
481+
{OPContent}
482+
<ObjectPageSection aria-label="Long Section" id="long-section" titleText="Long Section">
483+
<ObjectPageSubSection aria-label="Long Subsection 1" id="sub1" titleText="Long Subsection 1">
484+
<FlexBox style={{ height: '2000px' }} direction="Column" justifyContent="SpaceBetween">
485+
<span>Start SubSection1</span>
486+
<span>End SubSection1</span>
487+
</FlexBox>
488+
</ObjectPageSubSection>
489+
<ObjectPageSubSection aria-label="Long Subsection 2" id="sub2" titleText="Long Subsection 2">
490+
<FlexBox style={{ height: '1000px' }} direction="Column" justifyContent="SpaceBetween">
491+
<span>Start SubSection2</span>
492+
<span>End SubSection2</span>
493+
</FlexBox>
494+
</ObjectPageSubSection>
495+
</ObjectPageSection>
496+
</ObjectPage>,
497+
);
498+
cy.wait(100);
500499

501-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Long Section').focus();
502-
cy.realPress('ArrowDown');
503-
cy.get('[ui5-responsive-popover]').should('be.visible');
504-
cy.realPress('ArrowDown');
505-
cy.wait(50);
506-
cy.realPress('ArrowDown');
507-
cy.realPress('Enter');
508-
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected');
509-
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected');
510-
cy.get(`[ui5-tab][data-index="3"]`).shouldNeverHaveAttribute('selected');
511-
// wait for scroll
512-
cy.wait(200);
513-
cy.findByText('Start SubSection2').should('be.visible');
514-
});
515-
}
500+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Long Section').focus();
501+
cy.realPress('ArrowDown');
502+
cy.get('[ui5-responsive-popover]').should('be.visible');
503+
cy.realPress('ArrowDown');
504+
cy.wait(50);
505+
cy.realPress('ArrowDown');
506+
cy.realPress('Enter');
507+
cy.get('[data-section-id="test"]').shouldNeverHaveAttribute('selected');
508+
cy.get('[data-section-id="personal"]').shouldNeverHaveAttribute('selected');
509+
cy.get(`[ui5-tab][data-index="3"]`).shouldNeverHaveAttribute('selected');
510+
// wait for scroll
511+
cy.wait(200);
512+
cy.findByText('Start SubSection2').should('be.visible');
513+
});
516514

517515
it('scroll to sections - tab mode', () => {
518516
document.body.style.margin = '0px';

0 commit comments

Comments
 (0)