This commit is contained in:
Untone 2024-06-17 14:45:58 +03:00
parent 86c091f366
commit 9c530c4180
3 changed files with 1 additions and 59 deletions

View File

@ -197,7 +197,7 @@ export const apiClient = {
}, },
loadAuthorsBy: async (args: QueryLoad_Authors_ByArgs) => { loadAuthorsBy: async (args: QueryLoad_Authors_ByArgs) => {
const resp = await publicGraphQLClient.query(authorsLoadBy, args).toPromise() const resp = await publicGraphQLClient.query(authorsLoadBy, args).toPromise()
console.debug('[graphql.client.core] authorsLoadBy:', resp) // console.debug('[graphql.client.core] authorsLoadBy:', resp)
return resp.data.load_authors_by return resp.data.load_authors_by
}, },

View File

@ -1,21 +0,0 @@
import { expect, test } from '@playwright/test'
const baseHost = process.env.BASE_HOST || 'https://localhost:3000'
const pagesTitles = {
'/': /Дискурс/,
'/feed': /Лента/,
'/create': /Выберите тип публикации/,
'/about/help': /Поддержите Дискурс/,
'/authors': /Авторы/,
'/topics': /Темы и сюжеты/,
'/inbox': /Входящие/,
}
Object.keys(pagesTitles).forEach((res: string) => {
test(`страница ${res}`, async ({ page }) => {
await page.goto(`${baseHost}${res}`)
const title = pagesTitles[res]
await expect(page).toHaveTitle(title)
})
})

View File

@ -1,37 +0,0 @@
import { chromium } from 'playwright'
;(async () => {
const browser = await chromium.launch()
const context = await browser.newContext()
// Define the URLs to visit
const pagesToVisit = [
'https://localhost:3000/',
'https://localhost:3000/feed',
'https://localhost:3000/create',
'https://localhost:3000/about/donate',
'https://localhost:3000/authors',
'https://localhost:3000/topics',
'https://localhost:3000/inbox',
]
// Loop through the pages and visit each one
for (const pageUrl of pagesToVisit) {
const page = await context.newPage()
// Log a message before visiting the page
console.log(`Visiting page: ${pageUrl}`)
await page.goto(pageUrl)
// Add your test assertions here if needed
// Log a message after visiting the page
console.log(`Finished visiting page: ${pageUrl}`)
// Close the page before moving to the next one
await page.close()
}
// Close the browser
await browser.close()
})()