File size: 626 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Page, expect } from '@playwright/test'

export async function createIntegrationKey(
  page: Page,
  intKey: string,
  isMobile: boolean,
): Promise<void> {
  await page.getByRole('link', { name: 'Integration Keys' }).click()

  if (isMobile) {
    await page.getByRole('button', { name: 'Create Integration Key' }).click()
  } else {
    await page.getByTestId('create-key').click()
  }
  await page.getByLabel('Name').fill(intKey)
  await page.getByRole('button', { name: 'Submit' }).click()

  await expect(page.getByText(intKey)).toBeVisible()
  await expect(page.getByText('Generic Webhook URL')).toBeVisible()
}