Skip to content

Commit

Permalink
Merge pull request #63 from codex-storage/releases/v0.0.7
Browse files Browse the repository at this point in the history
Releases/v0.0.7
  • Loading branch information
2-towns authored Oct 22, 2024
2 parents e988a0e + 0b18026 commit 8763fbb
Show file tree
Hide file tree
Showing 11 changed files with 354 additions and 1,825 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
codex_version: v0.1.6
circuit_version: v0.1.6
codex_version: v0.1.7
circuit_version: v0.1.7
marketplace_address: "0xfE822Df439d987849a90B64a4C0e26a297DBD47F"
eth_provider: "https://rpc.testnet.codex.storage"
VITE_CODEX_API_URL: ${{ secrets.VITE_CODEX_API_URL }}
Expand Down
32 changes: 32 additions & 0 deletions e2e/download.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { test, expect } from '@playwright/test';
import { readFileSync } from 'fs';
import path, { dirname } from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

test('download a file', async ({ page, browserName }) => {
// https://github.com/microsoft/playwright/issues/13037
test.skip(browserName.toLowerCase() !== 'chromium',
`Test only for chromium!`);

await page.goto('/dashboard');
await page.locator('div').getByTestId("upload").setInputFiles([
path.join(__dirname, "assets", 'chatgpt.jpg'),
]);
await page.context().grantPermissions(["clipboard-read", "clipboard-write"]);
await page.locator('.files-fileActions > button:nth-child(3)').first().click();
await page.getByRole('button', { name: 'Copy CID' }).click();
const handle = await page.evaluateHandle(() => navigator.clipboard.readText());
const cid = await handle.jsonValue()
await page.locator('.sheets-container > .backdrop').click();
await page.getByPlaceholder('CID').click();
await page.getByPlaceholder('CID').fill(cid);
const page1Promise = page.waitForEvent('popup');
const downloadPromise = page.waitForEvent('download');
await page.locator('div').filter({ hasText: /^Download a fileDownload$/ }).getByRole('button').click();
const page1 = await page1Promise;
const download = await downloadPromise;
expect(await download.failure()).toBeNull()
});
8 changes: 5 additions & 3 deletions e2e/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ test('update the URL with wrong URL applies', async ({ page }) => {
await page.goto('/dashboard');
await page.getByRole('link', { name: 'Settings' }).click();
await page.getByLabel('Codex client node URL').click();

await page.getByLabel('Codex client node URL').fill('hello');
await expect.soft(page.getByText("The URL is not valid")).toBeVisible()
await expect.soft(page.locator(".settings-url-button")).toBeDisabled()
await page.getByLabel('Codex client node URL').fill('http://127.0.0.1:8079');
await expect.soft(page.getByText("The URL is not valid")).not.toBeVisible()
await expect.soft(page.locator(".settings-url-button")).not.toBeDisabled()
await page.getByRole('button', { name: 'Save changes' }).nth(1).click();

await expect.soft(page.getByText("Cannot retrieve the data")).toBeVisible()

await page.getByLabel('Codex client node URL').fill('http://127.0.0.1:8080');
await page.getByRole('button', { name: 'Save changes' }).nth(1).click();
})
2 changes: 1 addition & 1 deletion e2e/storage-requests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('select a uploaded cid when creating a storage request', async ({ page }) =
await page.getByRole('link', { name: 'Purchases' }).click();
await page.getByRole('button', { name: 'Storage Request' }).click();
await page.getByPlaceholder('Select or type your CID').click();
await page.getByText('N/A0').click();
await page.locator('.dropdown-option').nth(1).click();
await expect(page.getByText('button[disabled]')).not.toBeVisible();
})

Expand Down
Loading

0 comments on commit 8763fbb

Please sign in to comment.