Skip to content

Conversation

nmammadli
Copy link
Contributor

No description provided.

@@ -0,0 +1,33 @@
import {Selector, t} from 'testcafe';

export class RecommendationsPage {
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have recommendations.e2e.ts file with tests on recommendations,
also page objects for recommendations are in memory-efficiency-page.ts

so you can move this file content into memory-efficiency-page.ts or
move existing recommendations selectors from memory-efficiency-page.ts to your new file

notUsefulVoteBtn = Selector('[data-testid=not-useful-vote-btn]').nth(0);
recommendationsFeedbackBtn = Selector('[data-testid=recommendation-feedback-btn]');

async voteForVeryUsefulAndVerifyDisabled(): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

please add this function description into comment above, like here:
image

await this.verifyVoteDisabled();
}

async verifyVoteDisabled(): Promise<void>{
Copy link
Contributor

Choose a reason for hiding this comment

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

we are trying to not use methods for expects into pageObject folder
for this we use tests\e2e\common-actions
please move this function to common-actions

const recommendationPage = new RecommendationsPage();
const common = new Common();

fixture `Upvote recommendations`
Copy link
Contributor

Choose a reason for hiding this comment

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

please move this tests to tests\e2e\tests\critical-path\memory-efficiency\recommendations.e2e.ts

await t.click(memoryEfficiencyPage.newReportBtn);
await recommendationPage.voteForNotUsefulAndVerifyDisabled();
// Verify that user can see the popup with link when he votes for “Not useful”
await t.expect(recommendationPage.recommendationsFeedbackBtn.visible).ok();
Copy link
Contributor

Choose a reason for hiding this comment

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

pls add error message here .ok()

Refactor for page objects
@nmammadli nmammadli requested a review from vlad-dargel January 24, 2023 08:23

const memoryEfficiencyPage = new MemoryEfficiencyPage();
export class MemoryEfficiencyActions {
async voteForVeryUsefulAndVerifyDisabled(): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

just need a description for each method here
like:
/**
* Check that voted very useful is disabled
*/

Add comments to methods
@vlad-dargel vlad-dargel self-requested a review January 24, 2023 11:52
@nmammadli nmammadli merged commit 0999ce7 into feature/RI-3977_recommendation_voting Jan 24, 2023
@nmammadli nmammadli deleted the e2e/feature/RI-3977_recommendation_voting branch January 24, 2023 11:52
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