add a config for local testing, plus add mobile testing and some instructions
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('Confirm usage of test API', async ({ page }) => {
|
||||
test('Confirm usage of test API', async ({ page }, testInfo) => {
|
||||
// Load account view
|
||||
await page.goto('./account');
|
||||
await page.getByRole('heading', { name: 'Advanced' }).click();
|
||||
await expect(page.getByRole('textbox').nth(1)).toHaveValue('https://test-api.endorser.ch');
|
||||
|
||||
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 endorserServer = endorserTerm?.substring(ENDORSER_ENV_NAME.length + 1) || 'https://test-api.endorser.ch';
|
||||
await expect(page.getByRole('textbox').nth(1)).toHaveValue(endorserServer);
|
||||
});
|
||||
Reference in New Issue
Block a user