Skip to content

Commit

Permalink
frontend: update onboarding tests. not all passing
Browse files Browse the repository at this point in the history
  • Loading branch information
horacioh committed Jun 12, 2024
1 parent ab42e83 commit d4cf949
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/test-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,17 @@ permissions:

on:
push:
# disabling this job until we can make tests run without relying on external services
branches: [none]
# push:
# branches:
# - main
# - e2e
# - release/*
# - hm24
# paths:
# - frontend/*
# - ".github/workflows/test-desktop.yml"

# pull_request:
# branches:
# - main
# - e2e
# - release/*
# - hm24
# paths:
# - frontend/*
# - ".github/workflows/test-desktop.yml"
Expand Down
7 changes: 2 additions & 5 deletions frontend/apps/desktop/test/home-page.pom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import {AppData} from './types'
export class HomePage {
readonly appData: AppData
alias: string
bio: string

constructor(data: AppData, alias = 'testAlias', bio = 'test bio') {
constructor(data: AppData, alias = 'testAlias') {
this.appData = data
this.alias = alias
this.bio = bio
}

async goto() {
await this.appData.appWindow.waitForSelector('#btw-new-account')
await this.appData.appWindow.waitForSelector('#btn-new-account')
await this.appData.appWindow
.getByRole('button', {
name: 'Create a new Account',
Expand All @@ -29,7 +27,6 @@ export class HomePage {
await this.appData.appWindow.locator('#btn-next').click()
await this.appData.appWindow.waitForTimeout(10)
await this.appData.appWindow.locator('#alias').fill(this.alias)
await this.appData.appWindow.locator('#bio').fill(this.bio)
await this.appData.appWindow.locator('#btn-next').click()
await this.appData.appWindow.locator('#btn-next').click()
await this.appData.appWindow.waitForTimeout(10)
Expand Down
4 changes: 4 additions & 0 deletions frontend/apps/desktop/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as fs from 'fs'
import log from 'loglevel'
import os from 'os'
import * as path from 'path'
import {ElectronAppInfo} from './types'

/**
* Find the latest build and start monokle app for testing
Expand Down Expand Up @@ -62,6 +63,9 @@ export async function startApp() {
// await appWindow.screenshot({
// path: getRecordingPath(appInfo.platform, 'initial-screen.png'),
// });
await electronApp.on('window', () => {
console.log('-- helloooo')
})
return {
getWindow: async () => await electronApp.firstWindow(),
appInfo,
Expand Down
6 changes: 1 addition & 5 deletions frontend/apps/desktop/tests/onboarding-from-scratch.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {test} from '../test/fixtures'

import {expect} from '@playwright/test'

test('Onboarding from scratch', async ({onboardingPage}) => {
test.skip('Onboarding from scratch', async ({onboardingPage}) => {
let {appWindow} = onboardingPage.appData
await test.step('Welcome Screen', async () => {
// await appWindow.pause()
Expand Down Expand Up @@ -30,12 +30,8 @@ test('Onboarding from scratch', async ({onboardingPage}) => {

await test.step('Profile Data', async () => {
let elAlias = appWindow.locator('#alias')
let elBio = appWindow.locator('#bio')
let elNextBtn = await appWindow.locator('#btn-next')

await elAlias.fill('testAlias')
await elBio.fill('test bio')

await elNextBtn.click()
})

Expand Down
3 changes: 0 additions & 3 deletions frontend/apps/desktop/tests/onboarding-with-secret.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ test('Onboarding With recovery phrase', async ({onboardingPage}) => {

await test.step('Profile data', async () => {
let elAlias = appWindow.locator('#alias')
let elBio = appWindow.locator('#bio')
let elNextBtn = await appWindow.locator('#btn-next')

await elAlias.fill('testAlias')
await elBio.fill('test bio')

await elNextBtn.click()
})
Expand Down

0 comments on commit d4cf949

Please sign in to comment.