File size: 1,019 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { test, expect } from '@playwright/test'
import { adminUserCreds } from './lib'
const baseURL = 'http://localhost:6110'

test('should perform switchover', async ({ page, isMobile }) => {
  if (isMobile) {
    // we can only do this test once, so skip it on mobile
    return
  }
  test.slow()

  await page.goto(`${baseURL}/admin/switchover`)
  await page.fill('input[name=username]', adminUserCreds.user)
  await page.fill('input[name=password]', adminUserCreds.pass)
  await page.click('button[type=submit] >> "Login"')
  await expect(page.locator('main')).toContainText('Switchover Status')
  await expect(page.locator('main')).toContainText('Needs Reset')

  await page.click('button >> "Reset"')

  // will take some time to reset
  await expect(page.locator('main')).toContainText('Ready', { timeout: 30000 })

  await page.click('button >> "Execute"')

  // will take some time to execute
  await expect(page.locator('main')).toContainText(
    'DB switchover is complete',
    { timeout: 90000 },
  )
})