Skip to content

Commit

Permalink
Update swipeCardUp method and add tutorial steps
Browse files Browse the repository at this point in the history
  • Loading branch information
akdasa committed Dec 18, 2023
1 parent 9003f1e commit 425846a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/decks/InboxDeckPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class InboxDeckPage {

async swipeCardUp(distance: number = 240, steps: number = 2) {
await this.page.waitForTimeout(750)
await this.page.mouse.move(40, 580)
await this.page.mouse.move(40, 520)
await this.page.mouse.down()
await this.page.mouse.move(40, 580 - distance, { steps })
await this.page.mouse.move(40, 520 - distance, { steps })
await this.page.mouse.up()
await this.page.waitForTimeout(750)
}
Expand Down
16 changes: 14 additions & 2 deletions tests/tutorial/Tutorial.Full.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Application } from '@components/shared'
import { expect, test } from '@playwright/test'


test.describe('Tutorial :: Full', () => {
let app: Application

Expand All @@ -21,8 +20,21 @@ test.describe('Tutorial :: Full', () => {
await app.tutorial.card(6).waitFor()
await app.inboxDeck.swipeCardLeft()

// TODO: TBD later...
await app.tutorial.card(7).waitFor()
await app.inboxDeck.getCard("BG 1.1", "Text").click({ force: true })

await app.tutorial.card(8).waitFor()
await app.inboxDeck.getCard("BG 1.1", "Text").getByTestId("declamation-player").click()

await app.tutorial.card(9).waitFor()
await app.inboxDeck.getCard("BG 1.1", "Text").click({ force: true, position: { x: 10, y: 10 } })
await app.page.mouse.click(40, 240)

await app.tutorial.card(10).waitFor()
await app.inboxDeck.swipeCardUp()
await app.inboxDeck.swipeCardUp()

await app.tutorial.card(11).waitFor()
})

})

0 comments on commit 425846a

Please sign in to comment.