Skip to content

Commit

Permalink
update arcade specs
Browse files Browse the repository at this point in the history
  • Loading branch information
davikstone2 committed Jan 17, 2024
1 parent 6537d11 commit dd2302d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
29 changes: 13 additions & 16 deletions src/mods/redsquare/redsquare_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,25 @@ export default class RedsquarePage extends ModulePage {
super(page, "/redsquare");
}

async openChat() {

}

async createNewTweet() {
const newTweetButton = this.page.locator('#new-tweet');
await newTweetButton.click()
const tweetTextArea = this.page.locator('#post-tweet-textarea');
await expect(tweetTextArea).toBeVisible();
const selectors = {
newTweetButton: '#new-tweet',
tweetTextArea: '#post-tweet-textarea',
postTweetButton: '#post-tweet-button',
tweetTextElement: '.tweet-text'
};
await this.page.locator(selectors.newTweetButton).click();
await this.page.locator(selectors.tweetTextArea).waitFor();

const tweetText = "Hello, this is a test tweet!";
await tweetTextArea.fill(tweetText);
await this.page.locator(selectors.tweetTextArea).fill(tweetText);

const postTweetButton = this.page.locator('#post-tweet-button');
await postTweetButton.click();
await this.page.locator(selectors.postTweetButton).click();

await this.page.locator(`${selectors.tweetTextElement}`, { hasText: tweetText }).waitFor();

await this.page.waitForTimeout(5000);

const tweetTextElement = this.page.locator('.tweet-text', { hasText: tweetText });

await expect(tweetTextElement).toBeVisible();
await expect(this.page.locator(`${selectors.tweetTextElement}`)).toBeVisible();
}

}

3 changes: 1 addition & 2 deletions tests/mods/chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ test("chat loading in arcade", async ({ page }) => {
let chatManager = await page.locator('.chat-manager-list> .saito-user').click();

let chatInput = await page.$(".chat-footer > .saito-input > #text-input");
expect(chatInput).toBeTruthy();

expect(chatInput).toBeTruthy();

let testText = "E2E Test";

Expand All @@ -33,7 +33,6 @@ test("chat loading in arcade", async ({ page }) => {

chatMsg = await page.$(".chat-body > .saito-user:last-child > .saito-userline");
expect(chatMsg).toBeTruthy();

let text = await chatMsg.innerText();
console.log(text, testText)
expect(text.trim()).toEqual(testText.trim());
Expand Down
3 changes: 1 addition & 2 deletions tests/mods/redsquare.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { expect, test } from '@playwright/test';
import { test } from '@playwright/test';
import Redsquare from "../../src/mods/redsquare/redsquare_page";

test("Should load redsquare", async ({ page }) => {
let redsquare = new Redsquare(page);
await redsquare.goto();
// await arcade.createChessGame();
});

test("Should create new tweets", async ({ page }) => {
Expand Down

0 comments on commit dd2302d

Please sign in to comment.