Skip to content

test(e2e, playwright): added playwright e2e tests for /todo add, list and help commands#254

Open
rahulsuresh-git wants to merge 25 commits into
mattermost-community:masterfrom
rahulsuresh-git:feat/todo-e2e-basic-tests
Open

test(e2e, playwright): added playwright e2e tests for /todo add, list and help commands#254
rahulsuresh-git wants to merge 25 commits into
mattermost-community:masterfrom
rahulsuresh-git:feat/todo-e2e-basic-tests

Conversation

@rahulsuresh-git

@rahulsuresh-git rahulsuresh-git commented May 19, 2024

Copy link
Copy Markdown
Contributor

@mickmister mickmister left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for addressing the concerns on the other PRs @rahulsuresh-git 👍

This is looking good, just a few comments for discussion

// See LICENSE.txt for license information.

import core from './todo_plugin.spec';
import {test} from "@e2e-support/test_fixture";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can probably keep the styling of things as single quotes. I wonder why CI linting didn't catch these changes

};

export const getBotDMPageURL = async (teamName: string, botUsername: string) => {
return `${teamName}/messages/${botUsername}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need the @ symbol here right? Interesting how things are passing without this

Suggested change
return `${teamName}/messages/${botUsername}`;
return `${teamName}/messages/@${botUsername}`;

Comment on lines +16 to +24
postMessage,
} from "support/utils";

const botUserName = "todo";
let teamName = "";

test.beforeAll(async ({ pw }) => {
const { adminClient, adminUser } = await pw.getAdminClient();
if (adminUser === null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's inconsistent indentation in this file. Another thing the linter should be noticing. I'm thinking we should converge on 4 spaces for indenting

Comment on lines +90 to +93
await expect(post).toContainText(todoMessage);

// * Assert added todo is visible
await expect(post).toContainText(todoMessage);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These two lines are duplicated

Comment on lines +113 to +116
await expect(post).toContainText(todoMessage);

await expect(slash.getItemDescNth(0)).toHaveText('Available commands: list, add, pop, send, settings, help');
});
});
},
// * Assert added todo is visible
await expect(post).toContainText(todoMessage);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here, two lines are duplicated


test.beforeEach(async ({ page }) => {
const dmURL = await getBotDMPageURL(teamName, botUserName);
await page.goto(dmURL, { waitUntil: "load" });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm thinking we should clear the bot DMs before each test, since we're using the same channel for each test. We can use the function defined here for this:

export const cleanUpBotDMs = async (client: Client4, userId: UserProfile['id'], botUsername: string) => {

@hanzei hanzei added the Work In Progress Not yet ready for review label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Work In Progress Not yet ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants