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); });