From 853c9a21074cf642fd8053cb06d239b8a23010f9 Mon Sep 17 00:00:00 2001 From: William Grant Date: Tue, 18 Jul 2023 17:05:19 +1000 Subject: [PATCH] feat: fixed integration tests except for linked device profile sync, need to update avatar-update-blue files for linux --- .../dialog/EditProfilePictureModal.tsx | 8 +++++++- ts/test/automation/linked_device_user.spec.ts | 6 ++---- .../avatar-updated-blue-darwin.jpeg | Bin 1320 -> 1998 bytes ts/test/automation/setup/beforeEach.ts | 8 ++++---- ts/test/automation/user_actions.spec.ts | 8 +++----- .../avatar-updated-blue-darwin.jpeg | Bin 1014 -> 1112 bytes 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ts/components/dialog/EditProfilePictureModal.tsx b/ts/components/dialog/EditProfilePictureModal.tsx index 7f69082f6..2c21bf535 100644 --- a/ts/components/dialog/EditProfilePictureModal.tsx +++ b/ts/components/dialog/EditProfilePictureModal.tsx @@ -116,7 +116,12 @@ export const EditProfilePictureModal = (props: EditProfilePictureModalProps) => showHeader={true} showExitIcon={true} > -
+
{newAvatarObjectUrl || avatarPath ? ( buttonType={SessionButtonType.Simple} onClick={handleUpload} disabled={newAvatarObjectUrl === avatarPath} + dataTestId="save-button-profile-update" /> { await waitForTestIdWithText(windowA, 'copy-button-profile-update', 'Copy'); await clickOnTestIdWithText(windowA, 'image-upload-section'); + await clickOnTestIdWithText(windowA, 'image-upload-click'); await clickOnTestIdWithText(windowA, 'save-button-profile-update'); await waitForTestIdWithText(windowA, 'loading-spinner'); - await waitForTestIdWithText(windowA, 'copy-button-profile-update', 'Copy'); - await clickOnTestIdWithText(windowA, 'modal-close-button'); - - await sleepFor(500); + await sleepFor(5000); const leftpaneAvatarContainer = await waitForTestIdWithText(windowB, 'leftpane-primary-avatar'); await sleepFor(500); const screenshot = await leftpaneAvatarContainer.screenshot({ diff --git a/ts/test/automation/linked_device_user.spec.ts-snapshots/avatar-updated-blue-darwin.jpeg b/ts/test/automation/linked_device_user.spec.ts-snapshots/avatar-updated-blue-darwin.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s6)rMLi{YgMkJ z?$e{)2Ke7sbIX{)(#TQ&l4l1Mq!OEelWHA{*=wrJM5ZULtHYFPT@vaff4NE*#>Gy( zsxa5_wLm71FTYQy*wmu--<52)zlvBpUsB8|>GzwxE2g_+o@(B_8MIW_BY2myM(Eu` ztuW>Vj5!VOky-k+#?__q$Eh~*JILxRC07xsJ{Hq0rQUd>JRLJKKhn#}cZ(Dc-gt4} z=wO&{yBAHyh*!5hmpBQ{9XkSRM`lulH8bCO29>%Lb&VtzlFo>NM}wvtREZtpnWpCV z_>dv>#)DpsvrY4teE7j?p)WBaqbxK$E}e8H@JhA4Ez{$W&1?A*QH0IPK8LkIvkW4> Tij4oCfY^u)T$1|~s9W|h(}!6YNl96=#P*1!+KB8G_< zAAbCQi-Ct3XuKe^AcH-_xfdM`OiBt2-J6$wd0V$+M@4isoAjAU``g^CCjSZ5(p|94 zOh7x&bdztNkK&rVYJvK!Ws19gMsYi7+B6IHi}TmA1d3{h<)(&io94CK9_K5Ba0`_^6c>kkem%rmI`Wx;%RM`+n=``Ll| z-AnnF|LmP4wwdvau0qfJc-0HhEthPVu9knY^ocZ|^Vxm(_4W02hfm+hY?ZC`H7Gx( zH1W)jjXe(@Yn$gCU8NniaZd0SBduv>OH3-69y$KmGQV_r{?roD&308DTFUbxx$mV^ z=ssV-n5KJU*U{2z#bO;^M{6;^M&m|0V!^$OQWU diff --git a/ts/test/automation/setup/beforeEach.ts b/ts/test/automation/setup/beforeEach.ts index f47f97418..6ba353549 100644 --- a/ts/test/automation/setup/beforeEach.ts +++ b/ts/test/automation/setup/beforeEach.ts @@ -1,5 +1,5 @@ import { Page } from '@playwright/test'; -import { readdirSync, rmdirSync } from 'fs-extra'; +import { readdirSync, rm } from 'fs-extra'; import { join } from 'path'; import { homedir } from 'os'; import { isLinux, isMacOS } from '../../../OS'; @@ -25,9 +25,9 @@ function cleanUpOtherTest() { alreadyCleanedWaiting = true; const parentFolderOfAllDataPath = isMacOS() - ? '~/Library/Application Support/' + ? join(homedir(), 'Library', 'Application Support') : isLinux() - ? `${homedir()}/.config/` + ? join(homedir(), '.config') : null; if (!parentFolderOfAllDataPath) { throw new Error('Only macOS is currrently supported '); @@ -43,7 +43,7 @@ function cleanUpOtherTest() { allAppDataPath.map(folder => { const pathToRemove = join(parentFolderOfAllDataPath, folder); - rmdirSync(pathToRemove, { recursive: true }); + rm(pathToRemove, { recursive: true }, () => pathToRemove); }); console.info('...done'); } diff --git a/ts/test/automation/user_actions.spec.ts b/ts/test/automation/user_actions.spec.ts index d26476440..cc93bdd3f 100644 --- a/ts/test/automation/user_actions.spec.ts +++ b/ts/test/automation/user_actions.spec.ts @@ -132,7 +132,7 @@ sessionTestOneWindow('Change username', async ([window]) => { await window.click('.session-icon-button.small'); }); -sessionTestOneWindow('Change avatar', async ([window]) => { +sessionTestOneWindow('Change profile picture', async ([window]) => { await newUser(window, 'Alice'); // Open profile await clickOnTestIdWithText(window, 'leftpane-primary-avatar'); @@ -140,13 +140,11 @@ sessionTestOneWindow('Change avatar', async ([window]) => { await waitForTestIdWithText(window, 'copy-button-profile-update', 'Copy'); await clickOnTestIdWithText(window, 'image-upload-section'); + await clickOnTestIdWithText(window, 'image-upload-click'); await clickOnTestIdWithText(window, 'save-button-profile-update'); await waitForTestIdWithText(window, 'loading-spinner'); - await waitForTestIdWithText(window, 'copy-button-profile-update', 'Copy'); - await clickOnTestIdWithText(window, 'modal-close-button'); - - await sleepFor(500); + await sleepFor(5000); const leftpaneAvatarContainer = await waitForTestIdWithText(window, 'leftpane-primary-avatar'); await sleepFor(500); const screenshot = await leftpaneAvatarContainer.screenshot({ diff --git a/ts/test/automation/user_actions.spec.ts-snapshots/avatar-updated-blue-darwin.jpeg b/ts/test/automation/user_actions.spec.ts-snapshots/avatar-updated-blue-darwin.jpeg index 079323ef7cceff940f71519c5a4c6ef4300767fb..79defdd42effc9c516bf577f443c4b92e59d026c 100644 GIT binary patch delta 371 zcmeyyeuHDfIi~sr3>M6cN(@YbjLd?J|Bo<;F)%VRGN1rP4v@G2rnn$bTnea~i5W!) zGYbc}Q!_)t+fv9M8i;=+UfZ!z!yO<)pa7G$tz zID24XplE&4*S7glzm}`2zWe58G^^`0o5pL+f~BnTM!EZa^dBpf-aFB>%=A_}&y|JZ zL3cl^Zu@)Yail#PL(!2#n(WJ7gl*iuxy|Zi>Ys0#SEr>ga9Ny>;$f72dr(Z)foR Wx?_clrgt+~CM8S^6k%rme-i+8