Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd-android-live-update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CD Android Live Update
on:
push:
branches: [ main, master ]
branches: [main, master]
paths:
- 'android/capawesome.json'
- '.github/workflows/cd-android-live-update.yml'
Expand Down
1 change: 1 addition & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {defineConfig, devices} from '@playwright/test'
import 'tsconfig-paths/register'
import {execSync} from 'child_process'
import {config} from 'dotenv'

Expand Down
19 changes: 13 additions & 6 deletions tests/e2e/web/fixtures/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {HomePage} from '../pages/homePage'
import {OnboardingPage} from '../pages/onboardingPage'
import {ProfilePage} from '../pages/profilePage'
import {SignUpPage} from '../pages/signUpPage'
import {onboarding, OnboardingUser} from '../utils/accountInformation'
import {testAccounts, UserAccountInformation} from '../utils/accountInformation'
import {deleteUser} from '../utils/deleteUser'

export const test = base.extend<{
Expand All @@ -17,21 +17,28 @@ export const test = base.extend<{
authPage: AuthPage
compatabilityPage: ComatibilityPage
cleanUpUsers: void
testAccount: OnboardingUser
fakerAccount: OnboardingUser
onboardingAccount: UserAccountInformation
fakerAccount: UserAccountInformation
specAccount: UserAccountInformation
}>({
testAccount: async ({}, use) => {
const account = onboarding.account_one() // email captured here
onboardingAccount: async ({}, use) => {
const account = testAccounts.account_all_info() // email captured here
await use(account)
console.log('Cleaning up onboarding 1 account...')
await deleteUser(account.email, account.password) // same account, guaranteed
},
fakerAccount: async ({}, use) => {
const account = onboarding.faker_account() // email captured here
const account = testAccounts.faker_account() // email captured here
await use(account)
console.log('Cleaning up faker account...')
await deleteUser(account.email, account.password) // same account, guaranteed
},
specAccount: async ({}, use) => {
const account = testAccounts.spec_account()
await use(account)
console.log('Cleaning up spec account...')
await deleteUser(account.email, account.password)
},
onboardingPage: async ({page}, use) => {
const onboardingPage = new OnboardingPage(page)
await use(onboardingPage)
Expand Down
48 changes: 0 additions & 48 deletions tests/e2e/web/fixtures/deleteUserFixture.ts

This file was deleted.

5 changes: 5 additions & 0 deletions tests/e2e/web/pages/AuthPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@ export class AuthPage {
}

async clickSignInLink() {
await expect(this.signInLink).toBeVisible()
await this.signInLink.click()
}

async clickSignUpButton() {
await expect(this.signUpButton).toBeVisible()
await this.signUpButton.click()
}

async clickSignInWithEmailButton() {
await expect(this.signInWithEmailButton).toBeVisible()
await this.signInWithEmailButton.click()
}

async clickSignInWithGoogleButton() {
await expect(this.signInWithGoogleButton).toBeVisible()
await this.signInWithGoogleButton.click()
}

async clickSignUpWithEmailButton() {
await expect(this.signUpWithEmailButton).toBeVisible()
await this.signUpWithEmailButton.click()
}

Expand Down
123 changes: 59 additions & 64 deletions tests/e2e/web/pages/profilePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class ProfilePage {
private readonly dietAboutSection: Locator
private readonly languagesAboutSection: Locator
private readonly seekingAboutSection: Locator
private readonly relationshipTypeAboutSection: Locator
private readonly relationshipStatusAboutSection: Locator
private readonly educationAboutSection: Locator
private readonly occupationAboutSection: Locator
Expand Down Expand Up @@ -64,8 +63,8 @@ export class ProfilePage {
private readonly profileCompatibilityExplanation: Locator

constructor(public readonly page: Page) {
this.startAnsweringButton = page.getByRole('button', {})
this.doThisLaterLink = page.getByRole('button', {})
this.startAnsweringButton = page.getByRole('button', {name: 'Start answering'})
this.doThisLaterLink = page.getByRole('button', {name: 'Do this later'})
this.closeButton = page.getByRole('button', {name: 'Close'})
this.shareButton = page.getByRole('button', {name: 'Share'})
this.editProfileButton = page.getByTestId('profile-edit')
Expand All @@ -90,7 +89,6 @@ export class ProfilePage {
this.dietAboutSection = page.getByTestId('profile-about-diet')
this.languagesAboutSection = page.getByTestId('profile-about-languages')
this.seekingAboutSection = page.getByTestId('profile-about-seeking')
this.relationshipTypeAboutSection = page.getByTestId('profile-about-seeking')
this.relationshipStatusAboutSection = page.getByTestId('profile-about-relationship-status')
this.educationAboutSection = page.getByTestId('profile-about-education')
this.occupationAboutSection = page.getByTestId('profile-about-occupation')
Expand Down Expand Up @@ -321,8 +319,8 @@ export class ProfilePage {

async verifyDisplayName(displayName?: string) {
await expect(this.displayNameAndAgeSection).toBeVisible()
const textContent = await this.displayNameAndAgeSection.textContent()
if (displayName) await expect(textContent?.toLowerCase()).toContain(displayName.toLowerCase())
if (displayName)
await expect(this.displayNameAndAgeSection).toContainText(displayName, {ignoreCase: true})
}

async verifyGenderLocationHeightAge(
Expand All @@ -333,72 +331,73 @@ export class ProfilePage {
age?: string,
) {
await expect(this.genderLocationHightInInchesSection).toBeVisible()
const textContent = await this.genderLocationHightInInchesSection.textContent()
if (gender) await expect(textContent?.toLowerCase()).toContain(gender[0].toLowerCase())
if (location) await expect(textContent?.toLowerCase()).toContain(location.toLowerCase())
if (heightFeet) await expect(textContent?.toLowerCase()).toContain(heightFeet.toLowerCase())
if (heightInches) await expect(textContent?.toLowerCase()).toContain(heightInches.toLowerCase())
if (age) await expect(textContent?.toLowerCase()).toContain(age.toLowerCase())
if (gender)
await expect(this.genderLocationHightInInchesSection).toContainText(gender[0], {
ignoreCase: true,
})
if (location)
await expect(this.genderLocationHightInInchesSection).toContainText(location, {
ignoreCase: true,
})
if (heightFeet) await expect(this.genderLocationHightInInchesSection).toContainText(heightFeet)
if (heightInches)
await expect(this.genderLocationHightInInchesSection).toContainText(heightInches)
if (age) await expect(this.genderLocationHightInInchesSection).toContainText(age)
}

async verifyEthnicityOrigin(origin: string) {
await expect(this.ethnicityAboutSection).toBeVisible()
const textContent = await this.ethnicityAboutSection.textContent()
await expect(textContent?.toLowerCase()).toContain(origin.toLowerCase())
await expect(this.ethnicityAboutSection).toContainText(origin, {ignoreCase: true})
}

async verifyInterestedInConnectingWith(gender?: string[], minAge?: string, maxAge?: string) {
async verifySeeking(
gender?: string[],
minAge?: string,
maxAge?: string,
type?: string[],
interest?: string[],
) {
await expect(this.seekingAboutSection).toBeVisible()
const textContent = await this.seekingAboutSection.textContent()
if (gender) await expect(textContent?.toLowerCase()).toContain(gender[0].toLowerCase())
if (minAge) await expect(textContent?.toLowerCase()).toContain(minAge.toLowerCase())
if (maxAge) await expect(textContent?.toLowerCase()).toContain(maxAge.toLowerCase())
}

async verifyRelationShipTypeAndInterest(type?: string[], interest?: string[]) {
await expect(this.relationshipTypeAboutSection).toBeVisible()
const textContent = await this.relationshipTypeAboutSection.textContent()
if (type) await expect(textContent?.toLowerCase()).toContain(type[0].toLowerCase())
if (interest) await expect(textContent?.toLowerCase()).toContain(interest[0].toLowerCase())
if (gender) await expect(this.seekingAboutSection).toContainText(gender[0], {ignoreCase: true})
if (minAge) await expect(this.seekingAboutSection).toContainText(minAge)
if (maxAge) await expect(this.seekingAboutSection).toContainText(maxAge)
if (type) await expect(this.seekingAboutSection).toContainText(type[0], {ignoreCase: true})
if (interest)
await expect(this.seekingAboutSection).toContainText(interest[0], {ignoreCase: true})
}

async verifyRelationshipStatus(status: string[] | undefined) {
if (!status) return
await expect(this.relationshipStatusAboutSection).toBeVisible()
const textContent = await this.relationshipStatusAboutSection.textContent()
await expect(textContent?.toLowerCase()).toContain(status[0].toLowerCase())
await expect(this.relationshipStatusAboutSection).toContainText(status[0], {ignoreCase: true})
}

async verifyCurrentNumberOfKids(numberOfKids: string | undefined) {
if (!numberOfKids) return
await expect(this.hasKidsAboutSection).toBeVisible()
const textContent = await this.hasKidsAboutSection.textContent()
await expect(textContent?.toLowerCase()).toContain(numberOfKids.toLowerCase())
await expect(this.hasKidsAboutSection).toContainText(numberOfKids)
}

async verifyWantChildrenExpectation(expectation: [string, number] | undefined) {
if (!expectation) return
const [label, _value] = expectation
await expect(this.wantsKidsAboutSection).toBeVisible()
const textContent = await this.wantsKidsAboutSection.textContent()
await expect(textContent?.toLowerCase()).toContain(label.toLowerCase())
await expect(this.wantsKidsAboutSection).toContainText(label, {ignoreCase: true})
}

async verifyInterests(interest: string[] | undefined) {
if (!interest || interest.length === 0) return
await expect(this.interestsAboutSection).toBeVisible()
const textContent = await this.interestsAboutSection.textContent()
for (let i = 0; i < interest.length; i++) {
await expect(textContent?.toLowerCase()).toContain(interest[i].toLowerCase())
await expect(this.interestsAboutSection).toContainText(interest[i], {ignoreCase: true})
}
}

async verifyCauses(causes: string[] | undefined) {
if (!causes || causes.length === 0) return
await expect(this.causesAboutSection).toBeVisible()
const textContent = await this.causesAboutSection.textContent()
for (let i = 0; i < causes.length; i++) {
await expect(textContent?.toLowerCase()).toContain(causes[i].toLowerCase())
await expect(this.causesAboutSection).toContainText(causes[i], {ignoreCase: true})
}
}

Expand All @@ -412,86 +411,82 @@ export class ProfilePage {

async verifyEducationLevelAndUniversity(educationLevel?: string[], university?: string) {
await expect(this.educationAboutSection).toBeVisible()
const textContent = await this.educationAboutSection.textContent()
if (educationLevel)
await expect(textContent?.toLowerCase()).toContain(educationLevel[0].toLowerCase())
if (university) await expect(textContent?.toLowerCase()).toContain(university.toLowerCase())
await expect(this.educationAboutSection).toContainText(educationLevel[0], {ignoreCase: true})
if (university)
await expect(this.educationAboutSection).toContainText(university, {ignoreCase: true})
}

async verifyJobInformation(jobTitle?: string, company?: string) {
await expect(this.occupationAboutSection).toBeVisible()
const textContent = await this.occupationAboutSection.textContent()
if (jobTitle) await expect(textContent?.toLowerCase()).toContain(jobTitle.toLowerCase())
if (company) await expect(textContent?.toLowerCase()).toContain(company.toLowerCase())
if (jobTitle)
await expect(this.occupationAboutSection).toContainText(jobTitle, {ignoreCase: true})
if (company)
await expect(this.occupationAboutSection).toContainText(company, {ignoreCase: true})
}

async verifyPoliticalBeliefs(belief?: string[], details?: string) {
await expect(this.politicalAboutSection).toBeVisible()
const textContent = await this.politicalAboutSection.textContent()
if (belief) await expect(textContent?.toLowerCase()).toContain(belief[0].toLowerCase())
if (details) await expect(textContent?.toLowerCase()).toContain(details.toLowerCase())
if (belief)
await expect(this.politicalAboutSection).toContainText(belief[0], {ignoreCase: true})
if (details) await expect(this.politicalAboutSection).toContainText(details, {ignoreCase: true})
}

async verifyReligiousBeliefs(belief?: string[], details?: string) {
await expect(this.relegiousAboutSection).toBeVisible()
const textContent = await this.relegiousAboutSection.textContent()
if (belief) await expect(textContent?.toLowerCase()).toContain(belief[0].toLowerCase())
if (details) await expect(textContent?.toLowerCase()).toContain(details.toLowerCase())
if (belief)
await expect(this.relegiousAboutSection).toContainText(belief[0], {ignoreCase: true})
if (details) await expect(this.relegiousAboutSection).toContainText(details, {ignoreCase: true})
}

async verifyPersonalityType(personalityType: string | undefined) {
if (!personalityType) return
await expect(this.personalityAboutSection).toBeVisible()
const textContent = await this.personalityAboutSection.textContent()
await expect(textContent?.toLowerCase()).toContain(personalityType.toLowerCase())
await expect(this.personalityAboutSection).toContainText(personalityType, {ignoreCase: true})
}

async verifyBigFivePersonalitySection(personalityType: Record<string, number> | undefined) {
if (!personalityType) return
await expect(this.bigFivePersonalityTraitsAboutSection).toBeVisible()
const textContent = await this.bigFivePersonalityTraitsAboutSection.textContent()
for (const [key, value] of Object.entries(personalityType)) {
await expect(textContent?.toLowerCase()).toContain(key.toLowerCase())
await expect(textContent?.toLowerCase()).toContain(String(value))
await expect(this.bigFivePersonalityTraitsAboutSection).toContainText(key, {ignoreCase: true})
await expect(this.bigFivePersonalityTraitsAboutSection).toContainText(String(value))
}
}

async verifyDiet(diet: string[] | undefined) {
if (!diet) return
await expect(this.dietAboutSection).toBeVisible()
const textContent = await this.dietAboutSection.textContent()
await expect(textContent?.toLowerCase()).toContain(diet[0].toLowerCase())
await expect(this.dietAboutSection).toContainText(diet[0], {ignoreCase: true})
}

async verifySmoker(smoker: boolean | undefined) {
await expect(this.smokerAboutSection).toBeVisible()
const textContent = await this.smokerAboutSection.textContent()
if (smoker === true) await expect(textContent?.toLowerCase()).toContain('Smokes'.toLowerCase())
if (smoker === true)
await expect(this.smokerAboutSection).toContainText('Smokes', {ignoreCase: true})
if (smoker === false)
await expect(textContent?.toLowerCase()).toContain("Doesn't smoke".toLowerCase())
await expect(this.smokerAboutSection).toContainText("Doesn't smoke", {ignoreCase: true})
}

async verifyDrinksPerMonth(drinks: string | undefined) {
if (!drinks) return
await expect(this.drinkerAboutSection).toBeVisible()
const textContent = await this.drinkerAboutSection.textContent()
await expect(textContent?.toLowerCase()).toContain(drinks)
await expect(this.drinkerAboutSection).toContainText(drinks)
}

async verifyLanguages(languages: LanguageTuple[] | undefined) {
if (!languages || languages.length === 0) return
await expect(this.languagesAboutSection).toBeVisible()
const textContent = await this.languagesAboutSection.textContent()
for (const language of languages) {
await expect(textContent?.toLowerCase()).toContain(language[0].toLowerCase())
await expect(this.languagesAboutSection).toContainText(language[0], {ignoreCase: true})
}
}

async verifySocialMedia(socialMedia: Socials[] | undefined) {
if (!socialMedia || socialMedia.length === 0) return
await expect(this.socialMediaSection).toBeVisible()
const textContent = await this.socialMediaSection.textContent()
for (const {urlOrUsername} of socialMedia) {
await expect(textContent?.toLowerCase()).toContain(urlOrUsername.toLowerCase())
await expect(this.socialMediaSection).toContainText(urlOrUsername, {ignoreCase: true})
}
}

Expand Down
Loading
Loading