Skip to content

chore(ui5-carousel): migrate wdio tests to cypress #11328

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

duygu-rmdn
Copy link
Contributor

@duygu-rmdn duygu-rmdn requested a review from nnaydenow April 15, 2025 10:02
@duygu-rmdn duygu-rmdn requested a review from a team April 15, 2025 10:45
Copy link
Contributor

@nnaydenow nnaydenow left a comment

Choose a reason for hiding this comment

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

commands.ts looks good to me and there is approve from my side.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indent with tabs

</Carousel>);

cy.get("#carousel2")
.realHover()
Copy link
Contributor

Choose a reason for hiding this comment

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

Arrow should be displayed even without hovering, so delete line 24.
We should check why in Carousel#onBeforeRendering isDesktop() call returns true


it("Buttons (navigation arrows) are rendered in the navigation without hovering (arrows-placement)", () => {
cy.mount(
<Carousel id="carousel3" arrows-placement="Navigation">
Copy link
Contributor

Choose a reason for hiding this comment

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

<Carousel id="carousel3" arrowsPlacement="Navigation">

});

it("ItemsPerPage property is working properly", () => {
cy.mount(
Copy link
Contributor

Choose a reason for hiding this comment

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

Simplify this carousel to:

<Carousel id="carousel4">
	<span>page 1</span>
	<span>page 2</span>
	<span>page 3</span>
</Carousel>

Comment on lines +292 to +294
cy.get('#carousel5')
.then((carousel) => {
const el = carousel[0] as HTMLElement & { _id: string };
Copy link
Contributor

Choose a reason for hiding this comment

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

cy.get<Carousel>('#carousel5')
	.then(($carousel) => {
		const el = $carousel[0];


cy.get("#carousel6")
.shadow()
.find(".Carousel-navigation-arrows")
Copy link
Contributor

Choose a reason for hiding this comment

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

.find(".ui5-carousel-navigation-arrows")


cy.get("#carouselHiddenPageIndicator")
.shadow()
.find(".Carousel-navigation > *")
Copy link
Contributor

Choose a reason for hiding this comment

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

.find(".ui5-carousel-navigation > *")

Comment on lines +581 to +584
cy.get("#carousel9").then((carousel) => {
const el = carousel[0] as HTMLElement & { navigateTo: (index: number) => void };
el.navigateTo(1);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

cy.get<Carousel>("#carousel9").then(($carousel) => {
	$carousel[0].navigateTo(1);
});

Comment on lines +675 to +677
cy.get("#carouselF7").then((carousel) => {
const el = carousel[0] as HTMLElement & { navigateTo: (index: number) => void };
el.navigateTo(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

cy.get<Carousel>("#carousel9").then(($carousel) => {
	$carousel[0].navigateTo(1);
});


it("Items per page", () => {
cy.mount(
<Carousel
Copy link
Contributor

Choose a reason for hiding this comment

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

Simplify to:

<Carousel
	id="itemsPerPage"
	cyclic
	itemsPerPage="S1 M2 L3 XL4"
	arrowsPlacement="Navigation"
>
	<span>item 1</span>
	<span>item 2</span>
	<span>item 3</span>
	<span>item 4</span>
	<span>item 5</span>
</Carousel>

Copy link
Contributor

Choose a reason for hiding this comment

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

There are couple of cyclic="true" usages, which cause errors in the console. Should be replaced with cyclic={true}

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.

3 participants