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

Make navigation for challenge slick carousel and corresponding test #1995

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

Yatsynych-T
Copy link
Collaborator

This pull request introduces several enhancements to the ChallengeInfoPage and related files. The changes are focused on creating navigation to view the challenge's task on the view page, respective locators, and code formatting in basepage.js.

Changes:

New Feature:

Created a method for navigation to viewChallenge.
Added slick carousel locators.
Implemented a task presence verification method in the carousel.
Created a test to navigate the challenge task carousel.
Code Formatting:

Improved code formatting in basepage.js.

Files Modified:

src/test/playwright/PO/ChallengeInfoPage.js
Added new methods for navigation and task verification.
Modified existing methods for better readability.

src/test/playwright/PO/basepage.js
Improved code formatting.
Updated method names for clarity.

src/test/playwright/tests/challengesManipulation-test.spec.js
Added a test to verify navigation through challenge's existing tasks.

Testing:
Tested the new navigation features locally.
Verified that existing test cases related to challenge manipulation are still valid.

Copy link
Contributor

@softservedata softservedata left a comment

Choose a reason for hiding this comment

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

Please, update code

this.slickCardsNames = page.locator("div.slick-slide div.name");
this.slickDots = page.locator("ul.slick-dots li");
this.slickRightArrow = page.locator("div.challenge-day-block span[aria-label='arrow-right']:nth-child(2) svg");

Copy link
Contributor

Choose a reason for hiding this comment

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

Invalid locator nth-child(2)
DO not use hardcode.
Please update

Copy link
Contributor

Choose a reason for hiding this comment

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

$$("span.arrows-next svg")

@@ -15,6 +23,37 @@ class ChallengeInfoPage extends BasePage {
this.challengeTasksNames = page.locator("td:nth-child(2)");
Copy link
Contributor

Choose a reason for hiding this comment

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

Invalid locator nth-child(2)
Please update

Copy link
Contributor

Choose a reason for hiding this comment

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

$$("td.ant-table-cell > a.table-name[href*='task']")

Copy link
Contributor

Choose a reason for hiding this comment

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

$x("//a[contains(text(),'Task_second')]")


class ChallengeInfoPage extends BasePage {
constructor(page) {
super(page);
this.viewChallengeButton = page.getByRole("button", { name: "Переглянути челендж" });
Copy link
Contributor

Choose a reason for hiding this comment

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

Use const for "Переглянути челендж"

@@ -15,10 +15,6 @@ let apiservice, challengespage, challengeinfopage,taskspage, addchallengepage, a
apiservice = new ApiService(page);
challengespage = new ChallengesPage(page);
await apiservice.apiLoginAs('admin');
Copy link
Contributor

Choose a reason for hiding this comment

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

Use Const for "admin"

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@softservedata softservedata left a comment

Choose a reason for hiding this comment

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

ok

@softservedata softservedata merged commit d346008 into automation-tests Dec 1, 2023
5 checks passed
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.

2 participants