Skip to content

Commit

Permalink
Points tests to devhub.near rather than devgovgigs.near (#595)
Browse files Browse the repository at this point in the history
* converts devgovgigs to devhub

* fix: type
  • Loading branch information
elliotBraem authored Jan 11, 2024
1 parent 1bffa62 commit f375846
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 206 deletions.
4 changes: 2 additions & 2 deletions playwright-tests/tests/addons.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { test, expect } = require("@playwright/test");
const { test } = require("@playwright/test");

test.describe("Wallet is connected", () => {
test.use({
Expand All @@ -7,7 +7,7 @@ test.describe("Wallet is connected", () => {

test.describe("AddonsConfigurator", () => {
const baseUrl =
"/devgovgigs.near/widget/app?page=community.configuration&handle=devhub-test";
"/devhub.near/widget/app?page=community.configuration&handle=devhub-test";
// const dropdownSelector =
// 'input[data-component="near/widget/DIG.InputSelect"]';
// const addButtonSelector = "button.btn-success:has(i.bi.bi-plus)";
Expand Down
11 changes: 4 additions & 7 deletions playwright-tests/tests/blog.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { expect, test } from "@playwright/test";
import { waitForSelectorToBeVisible } from "../testUtils";

test("should load blogs in the sidebar for a given handle", async ({
page,
}) => {
await page.goto(
"/devgovgigs.near/widget/devhub.entity.addon.blog.Configurator?handle=devhub-test"
"/devhub.near/widget/devhub.entity.addon.blog.Configurator?handle=devhub-test"
);

await page.waitForSelector(`[id^="edit-blog-selector-"]`);
Expand All @@ -19,7 +18,7 @@ test("should prepopulate the form when a blog is selected from the left", async
page,
}) => {
await page.goto(
"/devgovgigs.near/widget/devhub.entity.addon.blog.Configurator?handle=devhub-test"
"/devhub.near/widget/devhub.entity.addon.blog.Configurator?handle=devhub-test"
);

await page.waitForSelector(`[id^="edit-blog-selector-"]`);
Expand Down Expand Up @@ -57,9 +56,7 @@ test("should prepopulate the form when a blog is selected from the left", async
});

test("should have an empty form if select new blog", async ({ page }) => {
await page.goto(
"/devgovgigs.near/widget/devhub.entity.addon.blog.Configurator"
);
await page.goto("/devhub.near/widget/devhub.entity.addon.blog.Configurator");

const newBlogSelector = `[id^="create-new-blog"]`;
await page.waitForSelector(newBlogSelector, {
Expand Down Expand Up @@ -96,7 +93,7 @@ test("should load a blog page and its blogs for a given community handle", async
page,
}) => {
await page.goto(
"/devgovgigs.near/widget/devhub.entity.addon.blog.Viewer?handle=devhub-test"
"/devhub.near/widget/devhub.entity.addon.blog.Viewer?handle=devhub-test"
);

const blogCardSelector = '[id^="blog-card-"]';
Expand Down
2 changes: 1 addition & 1 deletion playwright-tests/tests/bosloaderenvironment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test("should find bos loader configuration in localstorage", async ({
});

test("should not get bos loader fetch error", async ({ page }) => {
await page.goto("/devgovgigs.near/widget/gigs-board.pages.Feed");
await page.goto("/devhub.near/widget/app?page=feed");
const bodyText = await page.textContent("body");
expect(bodyText).not.toContain("BOS Loader fetch error");
});
15 changes: 6 additions & 9 deletions playwright-tests/tests/communities.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
setInputAndAssert,
clickWhenSelectorIsVisible,
setInputAndAssert,
waitForSelectorToBeVisible,
} from "../testUtils";

Expand All @@ -14,7 +14,7 @@ test.describe("Wallet is connected", () => {
test("should show spawner when user clicks create community", async ({
page,
}) => {
await page.goto("/devgovgigs.near/widget/app?page=communities");
await page.goto("/devhub.near/widget/app?page=communities");

const createCommunityButtonSelector = 'button:has-text("Create Community")';

Expand All @@ -23,24 +23,21 @@ test.describe("Wallet is connected", () => {
});
await page.click(createCommunityButtonSelector);

const communitySpawnerSelector = 'div:has-text("Community information")';
const communitySpawnerSelector = 'button:has-text("Launch")';
await page.waitForSelector(communitySpawnerSelector, { state: "visible" });
});

test("should validate input when user is creating a new community", async ({
page,
}) => {
await page.goto("/devgovgigs.near/widget/app?page=communities");
await page.goto("/devhub.near/widget/app?page=communities");

await clickWhenSelectorIsVisible(
page,
'button:has-text("Create Community")'
);

await waitForSelectorToBeVisible(
page,
'div:has-text("Community information")'
);
await waitForSelectorToBeVisible(page, 'button:has-text("Launch")');

// missing title
await expectInputValidation(
Expand Down Expand Up @@ -116,7 +113,7 @@ test.describe("Wallet is not connected", () => {
});

test("spawner and button should not be visible", async ({ page }) => {
await page.goto("/devgovgigs.near/widget/app?page=communities");
await page.goto("/devhub.near/widget/app?page=communities");

const createCommunityButtonSelector = 'button:has-text("Create Community")';

Expand Down
4 changes: 2 additions & 2 deletions playwright-tests/tests/community.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test("should load a community page if handle exists", async ({ page }) => {

test("should load an error page if handle does not exist", async ({ page }) => {
await page.goto(
"/devgovgigs.near/widget/app?page=community&handle=devhub-faketest"
"/devhub.near/widget/app?page=community&handle=devhub-faketest"
);

// Using the <Link> that wraps the card to identify a community
Expand Down Expand Up @@ -89,7 +89,7 @@ test.describe("Wallet is not connected", () => {
page,
}) => {
await page.goto(
"/devgovgigs.near/widget/app?page=community&handle=devhub-test"
"/devhub.near/widget/app?page=community&handle=devhub-test"
);

const createCommunityButtonSelector = 'button:has-text("Post")';
Expand Down
Loading

0 comments on commit f375846

Please sign in to comment.