forked from trent_larson/crowd-funder-for-time-pwa
Playwright: removed redundant tests
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Confirm usage of test API', async ({ page }, testInfo) => {
|
||||
// Load account view
|
||||
await page.goto('./account');
|
||||
await page.getByRole('heading', { name: 'Advanced' }).click();
|
||||
|
||||
// look into the config file: if it starts Time Safari, it might say which server it should set by default
|
||||
const webServer = testInfo.config.webServer;
|
||||
const endorserWords = webServer?.command.split(' ');
|
||||
const ENDORSER_ENV_NAME = 'VITE_DEFAULT_ENDORSER_API_SERVER';
|
||||
const endorserTerm = endorserWords?.find(word => word.startsWith(ENDORSER_ENV_NAME + '='));
|
||||
const endorserTermInConfig = endorserTerm?.substring(ENDORSER_ENV_NAME.length + 1);
|
||||
|
||||
const endorserServer = endorserTermInConfig || 'https://test-api.endorser.ch';
|
||||
await expect(page.getByRole('textbox').nth(1)).toHaveValue(endorserServer);
|
||||
});
|
||||
@@ -1,12 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Check activity feed', async ({ page }) => {
|
||||
// Load app homepage
|
||||
await page.goto('./');
|
||||
|
||||
// Check that initial 10 activities have been loaded
|
||||
await page.locator('ul#listLatestActivity li:nth-child(10)');
|
||||
|
||||
// Scroll down a bit to trigger loading additional activities
|
||||
await page.locator('ul#listLatestActivity li:nth-child(50)').scrollIntoViewIfNeeded();
|
||||
});
|
||||
@@ -1,12 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Check discover results', async ({ page }) => {
|
||||
// Load Discover view
|
||||
await page.goto('./discover');
|
||||
|
||||
// Check that initial 10 projects have been loaded
|
||||
await page.locator('ul#listDiscoverResults li.border-b:nth-child(10)');
|
||||
|
||||
// Scroll down a bit to trigger loading additional projects
|
||||
await page.locator('ul#listDiscoverResults li.border-b:nth-child(20)').scrollIntoViewIfNeeded();
|
||||
});
|
||||
@@ -1,23 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Check no-ID messaging in homepage', async ({ page }) => {
|
||||
// Load app homepage
|
||||
await page.goto('./');
|
||||
|
||||
// Check 'someone must register you' notice
|
||||
await expect(page.getByText('To share, someone must register you.')).toBeVisible();
|
||||
});
|
||||
|
||||
test('Check no-ID messaging in account', async ({ page }) => {
|
||||
// Load account view
|
||||
await page.goto('./account');
|
||||
|
||||
// Check 'someone must register you' notice
|
||||
await expect(page.locator('#noticeBeforeShare')).toBeVisible();
|
||||
|
||||
// Check 'a friend needs to register you' notice
|
||||
await expect(page.locator('#noticeBeforeAnnounce')).toBeVisible();
|
||||
|
||||
// Check that there is no ID
|
||||
await expect(page.locator('#sectionIdentityDetails code.truncate')).toBeEmpty();
|
||||
});
|
||||
@@ -1,21 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Check ID generation', async ({ page }) => {
|
||||
// Load Account view
|
||||
await page.goto('./account');
|
||||
|
||||
// Check that ID is empty
|
||||
await expect(page.locator('#sectionIdentityDetails code.truncate')).toBeEmpty();
|
||||
|
||||
// Load homepage to trigger ID generation (?)
|
||||
await page.goto('./');
|
||||
|
||||
// Wait for activity feed to start loading, as a delay
|
||||
await expect(page.locator('ul#listLatestActivity li:nth-child(10)')).toBeVisible();
|
||||
|
||||
// Go back to Account view
|
||||
await page.goto('./account');
|
||||
|
||||
// Check that ID is now generated
|
||||
await expect(page.locator('#sectionIdentityDetails code.truncate')).toContainText('did:ethr:');
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Create user 00', async ({ page }) => {
|
||||
// Create new ID using seed phrase "rigid shrug mobile…"
|
||||
await page.goto('./start');
|
||||
await page.getByText('You have a seed').click();
|
||||
await page.getByPlaceholder('Seed Phrase').fill('rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage');
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Set name
|
||||
await page.getByRole('link', { name: 'Set Your Name' }).click();
|
||||
await page.getByPlaceholder('Name').fill('User Zero');
|
||||
await page.getByRole('button', { name: 'Save Changes' }).click();
|
||||
|
||||
// Check DID
|
||||
await expect(page.getByRole('code')).toContainText('did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F');
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Create user 01', async ({ page }) => {
|
||||
// Create new ID using seed phrase "island fever beef…"
|
||||
await page.goto('./start');
|
||||
await page.getByText('You have a seed').click();
|
||||
await page.getByPlaceholder('Seed Phrase').fill('island fever beef wine urban aim vacant quit afford total poem flame service calm better adult neither color gaze forum month sister imitate excite');
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Set name
|
||||
await page.getByRole('link', { name: 'Set Your Name' }).click();
|
||||
await page.getByPlaceholder('Name').fill('User One');
|
||||
await page.getByRole('button', { name: 'Save Changes' }).click();
|
||||
|
||||
// Check DID
|
||||
await expect(page.getByRole('code')).toContainText('did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39');
|
||||
});
|
||||
@@ -1,28 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Check usage limits', async ({ page }) => {
|
||||
// Check without ID first
|
||||
await page.goto('./account');
|
||||
await expect(page.locator('div.bg-slate-100.rounded-md').filter({ hasText: 'Usage Limits' })).toBeHidden();
|
||||
|
||||
// Create new ID using seed phrase "island fever beef…"
|
||||
await page.goto('./start');
|
||||
await page.getByText('You have a seed').click();
|
||||
await page.getByPlaceholder('Seed Phrase').fill('island fever beef wine urban aim vacant quit afford total poem flame service calm better adult neither color gaze forum month sister imitate excite');
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Set name
|
||||
await page.getByRole('link', { name: 'Set Your Name' }).click();
|
||||
await page.getByPlaceholder('Name').fill('User One');
|
||||
await page.getByRole('button', { name: 'Save Changes' }).click();
|
||||
|
||||
// Check DID
|
||||
await expect(page.getByRole('code')).toContainText('did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39');
|
||||
|
||||
// Verify that "Usage Limits" section is visible
|
||||
await expect(page.locator('#sectionUsageLimits')).toBeVisible();
|
||||
await expect(page.getByText('Your claims counter resets')).toBeVisible();
|
||||
await expect(page.getByText('Your registration counter resets')).toBeVisible();
|
||||
await expect(page.getByText('Your image counter resets')).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Recheck Limits' })).toBeVisible();
|
||||
});
|
||||
@@ -1,56 +0,0 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Create new project, then search for it', async ({ page }) => {
|
||||
// Generate a random string of 16 characters
|
||||
let randomString = Math.random().toString(36).substring(2, 18);
|
||||
|
||||
// In case the string is shorter than 16 characters, generate more characters until it is 16 characters long
|
||||
while (randomString.length < 16) {
|
||||
randomString += Math.random().toString(36).substring(2, 18);
|
||||
}
|
||||
const finalRandomString = randomString.substring(0, 16);
|
||||
|
||||
// Standard texts
|
||||
const standardTitle = "Idea ";
|
||||
const standardDescription = "Description of Idea ";
|
||||
|
||||
// Combine texts with the random string
|
||||
const finalTitle = standardTitle + finalRandomString;
|
||||
const finalDescription = standardDescription + finalRandomString;
|
||||
|
||||
// Create new ID using seed phrase "rigid shrug mobile…"
|
||||
await page.goto('./start');
|
||||
await page.getByText('You have a seed').click();
|
||||
await page.getByPlaceholder('Seed Phrase').fill('rigid shrug mobile smart veteran half all pond toilet brave review universe ship congress found yard skate elite apology jar uniform subway slender luggage');
|
||||
await page.getByRole('button', { name: 'Import' }).click();
|
||||
|
||||
// Set name
|
||||
await page.getByRole('link', { name: 'Set Your Name' }).click();
|
||||
await page.getByPlaceholder('Name').fill('User Zero');
|
||||
await page.getByRole('button', { name: 'Save Changes' }).click();
|
||||
|
||||
// Pause for 5 seconds
|
||||
await page.waitForTimeout(5000); // I have to wait, otherwise the (+) button to add a new project doesn't appear
|
||||
|
||||
// Create new project
|
||||
await page.goto('./projects');
|
||||
await page.getByRole('link', { name: 'Projects', exact: true }).click();
|
||||
await page.getByRole('button').click();
|
||||
await page.getByPlaceholder('Idea Name').fill(finalTitle); // Add random suffix
|
||||
await page.getByPlaceholder('Description').fill(finalDescription);
|
||||
await page.getByPlaceholder('Website').fill('https://example.com');
|
||||
await page.getByPlaceholder('Start Date').fill('2025-12-01');
|
||||
await page.getByPlaceholder('Start Time').fill('12:00');
|
||||
await page.getByRole('button', { name: 'Save Project' }).click();
|
||||
|
||||
// Check texts
|
||||
await expect(page.locator('h2')).toContainText(finalTitle);
|
||||
await expect(page.locator('#Content')).toContainText(finalDescription);
|
||||
|
||||
// Search for project that was just created
|
||||
await page.goto('./discover');
|
||||
await page.waitForTimeout(5000); // Wait for a bit
|
||||
await page.getByPlaceholder('Search…').fill(finalRandomString);
|
||||
await page.locator('#QuickSearch button').click();
|
||||
await expect(page.locator('ul#listDiscoverResults li.border-b:nth-child(1)')).toContainText(finalRandomString);
|
||||
});
|
||||
Reference in New Issue
Block a user