Skip to content

Commit

Permalink
updates e2e test link
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiral-Memory committed Sep 5, 2024
1 parent f2e00df commit 7a0378b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 23 deletions.
16 changes: 8 additions & 8 deletions packages/e2e-react/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export default defineConfig({

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
// {
// name: 'chromium',
// use: { ...devices['Desktop Chrome'] },
// },

// {
// name: 'firefox',
Expand All @@ -62,10 +62,10 @@ export default defineConfig({
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
],

/* Run your local dev server before starting the tests */
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { EmbeddedChat } from "@embeddedchat/react";
function App() {
return (
<EmbeddedChat
host="https://chat.avitechlab.com"
roomId="GENERAL"
host="https://demo.qa.rocket.chat"
roomId="66ccc4f1e050428c76256939"
anonymousMode={true}
/>
);
Expand Down
41 changes: 28 additions & 13 deletions packages/e2e-react/tests/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
import { test, expect } from '@playwright/test';
import { test, expect } from "@playwright/test";

test('EmbeddedChat should render', async ({ page }) => {
await page.goto('/');
await expect(page.locator('.ec-embedded-chat')).toBeVisible();
});
test.describe.serial("EmbeddedChat Tests", () => {
test("EmbeddedChat should render", async ({ page }) => {
await page.goto("/");
await expect(page.locator(".ec-embedded-chat")).toBeVisible();
});

test('EmbeddedChat has a title', async ({ page }) => {
await page.goto('/');
await expect(page.locator('.ec-chat-header--channelName')).toHaveText('Login to chat');
});
test("EmbeddedChat has a title", async ({ page }) => {
await page.goto("/");
await expect(page.locator(".ec-chat-header--channelName")).toHaveText(
"Login to chat"
);
});

test("Login and check for messages", async ({ page }) => {
await page.goto("/");
await page.click('button.ec-button:has-text("JOIN")');

await expect(
page.locator('.ec-modal-title:has-text("Login")')
).toBeVisible();

await page.fill('input[placeholder="example@example.com"]', "test_acc");
await page.fill('input[placeholder="Password"]', "test_acc");

await page.click('button:has-text("Login")');

test('EmbeddedChat has messages', async ({ page }) => {
await page.goto('/');
await page.waitForSelector(".ec-message");

await page.waitForSelector('.ec-message');
expect(await page.locator('.ec-message').count()).toBeGreaterThan(0);
expect(await page.locator(".ec-message").count()).toBeGreaterThan(0);
});
});
1 change: 1 addition & 0 deletions packages/react/src/views/LoginForm/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default function LoginForm() {
{
label: 'Password',
type: showPassword ? 'text' : 'password',
placeholder: 'Password',
onChange: handleEditPassword,
error: passwordError,
},
Expand Down

0 comments on commit 7a0378b

Please sign in to comment.