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

[ACS-6510] playwright List View e2e test #3566

Merged
merged 25 commits into from
Dec 22, 2023

Conversation

akashrathod28
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe: e2e playwright test

What is the current behaviour? (You can also link to an open issue here)
protractor List View e2e Test

What is the new behaviour? new playwright test

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information: https://alfresco.atlassian.net/browse/ACS-6510

package.json Outdated Show resolved Hide resolved
}

test.describe('Remember sorting', () => {
interface NodesIds {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this interface? It can be a simple array of strings instead I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this interface

} from '@alfresco/playwright-shared';

test.describe('Remember sorting', () => {
interface NodesIds {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this interface.

timeouts
} from '@alfresco/playwright-shared';

test.describe('Remember sorting', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to run those tests together with ones related to login in the upper file? The setup is quite similar and in this way we can reuse some setup code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was getting some failure due to logout related test, now tries some approach and add code in one file.

parentId: string = '-my-',
title: string = '',
description: string = ''
): Promise<NodeEntry | null> {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to return Promise I wouldn't just return null, you can return rejected promise instead and catch it whenever you use the method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed and added reject promise

majorVersion: boolean = true,
comment?: string,
newName?: string
): Promise<NodeEntry | null> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed and added reject promise

if (isEmpty) {
return this.emptyListTitle.innerText();
}
return '';
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be shorter like: return await this.isEmpty() ? this.emptyListTitle.innerText() : '';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added suggested changes. looks good

if (isEmpty) {
return this.emptyListSubtitle.innerText();
}
return '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be shorter as well like in the example above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added suggested changes. looks good

if (isEmpty) {
return this.getChild('adf-custom-empty-content-template').innerText();
}
return '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added suggested changes. looks good

@@ -166,4 +166,12 @@ export class PaginationComponent extends BaseComponent {
async closeMenu(): Promise<void> {
await this.page.keyboard.press('Escape');
}

async isRangePresent() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you specify the return type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added return promise type

return this.range.isVisible();
}

async isMaxItemsPresent() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you specify the return type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added return promise type

@akashrathod28 akashrathod28 requested review from MichalKinas and removed request for MichalKinas December 21, 2023 13:39
Copy link

sonarcloud bot commented Dec 21, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@akashrathod28 akashrathod28 merged commit 7465bbb into develop Dec 22, 2023
25 checks passed
@akashrathod28 akashrathod28 deleted the dev-akashrathod28-playwright-listview branch December 22, 2023 08:36
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.

None yet

3 participants