mirror of
https://github.com/logos-storage/logos-storage-marketplace-ui.git
synced 2026-05-28 20:29:31 +00:00
CI
This commit is contained in:
parent
cbe7d3bec7
commit
231cc090c8
2
.env.ci
Normal file
2
.env.ci
Normal file
@ -0,0 +1,2 @@
|
||||
VITE_CODEX_API_URL=http://localhost:8080
|
||||
VITE_GEO_IP_URL=https://geoip.codex.storage
|
||||
5
.github/workflows/playwright.yml
vendored
5
.github/workflows/playwright.yml
vendored
@ -110,11 +110,6 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run the marketplace
|
||||
run: |
|
||||
npm run dev &
|
||||
sleep 5
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import test, { expect } from "@playwright/test";
|
||||
import { APP_URL } from './constants';
|
||||
|
||||
test('creates an availability', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
await page.getByRole('link', { name: 'Sales' }).click();
|
||||
await page.getByRole('button').first().click();
|
||||
await page.getByLabel('Total size').click();
|
||||
@ -26,7 +25,7 @@ test('creates an availability', async ({ page }) => {
|
||||
})
|
||||
|
||||
test('availability navigation buttons', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard/availabilities');
|
||||
await page.goto('/dashboard/availabilities');
|
||||
await page.getByRole('button').first().click();
|
||||
await expect(page.locator('.stepper-number-done')).not.toBeVisible()
|
||||
await expect(page.locator('.stepper-number-active')).toBeVisible()
|
||||
|
||||
@ -1 +0,0 @@
|
||||
export const APP_URL = "http://localhost:5173"
|
||||
@ -1,8 +1,7 @@
|
||||
import test, { expect } from "@playwright/test";
|
||||
import { APP_URL } from './constants';
|
||||
|
||||
test('update the log level', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
await page.getByRole('link', { name: 'Settings' }).click();
|
||||
await page.getByLabel('Log level').selectOption('TRACE');
|
||||
await page.getByRole('main').locator('div').filter({ hasText: 'Log' }).getByRole('button').click();
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import test, { expect } from "@playwright/test";
|
||||
import path, { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { APP_URL } from './constants';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
test('creates a storage request', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
await page.getByRole('link', { name: 'Purchases' }).click();
|
||||
await page.getByRole('button', { name: 'Storage Request' }).click();
|
||||
await page.locator('div').getByTestId("upload").setInputFiles([
|
||||
@ -24,7 +23,7 @@ test('creates a storage request', async ({ page }) => {
|
||||
})
|
||||
|
||||
test('select a uploaded cid when creating a storage request', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
await page.locator('div').getByTestId("upload").setInputFiles([
|
||||
path.join(__dirname, "assets", 'chatgpt.jpg'),
|
||||
]);
|
||||
@ -36,7 +35,7 @@ test('select a uploaded cid when creating a storage request', async ({ page }) =
|
||||
})
|
||||
|
||||
test('storage request navigation buttons', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard/purchases');
|
||||
await page.goto('/dashboard/purchases');
|
||||
await page.getByRole('button', { name: 'Storage Request' }).click();
|
||||
await expect(page.locator('.stepper-number-done')).not.toBeVisible()
|
||||
await expect(page.locator('.stepper-number-active')).toBeVisible()
|
||||
|
||||
@ -3,13 +3,12 @@ import { Buffer } from 'buffer';
|
||||
import { readFileSync } from 'fs';
|
||||
import path, { dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { APP_URL } from './constants';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
test('upload one file', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
await page.getByText('browse').click();
|
||||
await page.locator('div').getByTestId("upload").setInputFiles([
|
||||
path.join(__dirname, "assets", 'chatgpt.jpg'),
|
||||
@ -19,7 +18,7 @@ test('upload one file', async ({ page }) => {
|
||||
});
|
||||
|
||||
test('multiple files upload', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
await page.getByText('browse').click();
|
||||
await page.locator('div').getByTestId("upload").setInputFiles([
|
||||
path.join(__dirname, "assets", 'chatgpt.jpg'),
|
||||
@ -38,7 +37,7 @@ test('multiple files upload', async ({ page }) => {
|
||||
});
|
||||
|
||||
test('drag and drop file', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
|
||||
const buffer = readFileSync(path.join(__dirname, "assets", 'chatgpt.jpg'));
|
||||
|
||||
@ -57,7 +56,7 @@ test('drag and drop file', async ({ page }) => {
|
||||
});
|
||||
|
||||
test('stop an upload display a message', async ({ page }) => {
|
||||
await page.goto(APP_URL + '/dashboard');
|
||||
await page.goto('/dashboard');
|
||||
await page.getByText('browse').click();
|
||||
|
||||
const buffer = Buffer.alloc(10_000_000);
|
||||
|
||||
13
package-lock.json
generated
13
package-lock.json
generated
@ -32,6 +32,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
||||
"@typescript-eslint/parser": "^8.7.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"dotenv": "^16.4.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-react-refresh": "^0.4.12",
|
||||
@ -2232,6 +2233,18 @@
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "16.4.5",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
|
||||
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://dotenvx.com"
|
||||
}
|
||||
},
|
||||
"node_modules/echarts": {
|
||||
"version": "5.5.1",
|
||||
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.5.1.tgz",
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"format": "prettier --write ./src",
|
||||
"test": "npx playwright test"
|
||||
"test": "npx playwright test --ui"
|
||||
},
|
||||
"keywords": [
|
||||
"Codex",
|
||||
@ -47,6 +47,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
||||
"@typescript-eslint/parser": "^8.7.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"dotenv": "^16.4.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-react-refresh": "^0.4.12",
|
||||
@ -61,4 +62,4 @@
|
||||
"author": "Codex team",
|
||||
"readme": "README.md",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
/**
|
||||
* Read environment variables from file.
|
||||
* https://github.com/motdotla/dotenv
|
||||
*/
|
||||
// import dotenv from 'dotenv';
|
||||
// import path from 'path';
|
||||
// dotenv.config({ path: path.resolve(__dirname, '.env') });
|
||||
import dotenv from 'dotenv';
|
||||
import path, { dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
dotenv.config({ path: path.resolve(__dirname, '.env.ci') });
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
@ -26,7 +30,7 @@ export default defineConfig({
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
// baseURL: 'http://127.0.0.1:3000',
|
||||
baseURL: 'http://127.0.0.1:5173',
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: 'on-first-retry',
|
||||
@ -71,9 +75,9 @@ export default defineConfig({
|
||||
],
|
||||
|
||||
/* Run your local dev server before starting the tests */
|
||||
// webServer: {
|
||||
// command: 'npm run start',
|
||||
// url: 'http://127.0.0.1:3000',
|
||||
// reuseExistingServer: !process.env.CI,
|
||||
// },
|
||||
webServer: {
|
||||
command: 'npm run dev',
|
||||
url: 'http://127.0.0.1:5173',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user