(playwright.config.ts): set the number of workers to 2 to improve test parallelization

📝 (API/index.ts): remove conditional return of 100 for getRepoStars function to ensure accurate retrieval of stargazers count from GitHub API
📝 (API/index.ts): remove conditional return of example data for getExamples function to ensure accurate retrieval of examples from GitHub API
📝 (auto_login.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (codeAreaModalComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (dragAndDrop.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (dropdownComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (floatComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (flowPage.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (group.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (inputComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (intComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (keyPairListComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (langflowShortcuts.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (nestedComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues
📝 (promptModalComponent.spec.ts): update page.goto URLs to include the protocol to fix navigation issues

 (saveComponents.spec.ts): update page.goto() URL to include the correct protocol and port for the frontend app
 (toggleComponent.spec.ts): update page.goto() URL to include the correct protocol and port for the frontend app
This commit is contained in:
cristhianzl 2024-03-27 17:04:19 -03:00
commit a99612af3b
17 changed files with 18 additions and 34 deletions

View file

@ -18,7 +18,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 2 : undefined,
workers: 2,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
timeout: 120 * 1000,
// reporter: [

View file

@ -40,9 +40,6 @@ const GITHUB_API_URL = "https://api.github.com";
export async function getRepoStars(owner: string, repo: string) {
try {
if (process.env.CI === "True") {
return 100;
}
const response = await api.get(`${GITHUB_API_URL}/repos/${owner}/${repo}`);
return response.data.stargazers_count;
} catch (error) {
@ -92,19 +89,6 @@ export async function postValidatePrompt(
* @returns {Promise<FlowType[]>} A promise that resolves to an array of FlowType objects.
*/
export async function getExamples(): Promise<FlowType[]> {
debugger;
if (process.env.CI === "True") {
return new Promise((resolve, reject) => {
resolve([
{
name: "Example",
id: "example",
data: null,
description: "Example description",
},
]);
});
}
const url =
"https://api.github.com/repos/logspace-ai/langflow_examples/contents/examples?ref=main";
const response = await api.get(url);

View file

@ -2,12 +2,12 @@ import { test } from "@playwright/test";
test.describe("Auto_login tests", () => {
test("auto_login sign in", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
});
test("auto_login block_admin", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(5000);

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("CodeAreaModalComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -4,7 +4,7 @@ import { readFileSync } from "fs";
test.describe("drag and drop test", () => {
/// <reference lib="dom"/>
test("drop collection", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
// Read your file into a buffer.
const jsonContent = readFileSync(

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("dropDownComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("FloatComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -2,12 +2,12 @@ import { Page, test } from "@playwright/test";
test.describe("Flow Page tests", () => {
async function goToFlowPage(page: Page) {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.getByRole("button", { name: "New Project" }).click();
}
test("save", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -4,7 +4,7 @@ import { readFileSync } from "fs";
test.describe("group node test", () => {
/// <reference lib="dom"/>
test("group and ungroup updating values", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByTestId("blank-flow").click();

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("InputComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("IntComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("KeypairListComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -10,7 +10,7 @@ test("LangflowShortcuts", async ({ page }) => {
control = "Meta";
}
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("NestedComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("PromptTemplateComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();

View file

@ -11,7 +11,7 @@ test.describe("save component tests", () => {
/// <reference lib="dom"/>
test("save group component tests", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByTestId("blank-flow").click();

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test("ToggleComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();