-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starts disappearing messages tests for all media types #15
Starts disappearing messages tests for all media types #15
Conversation
chore: fix eslint conflict with airbnb base
… previews and community invites
package.json
Outdated
@@ -30,6 +31,7 @@ | |||
}, | |||
"scripts": { | |||
"lint": "yarn prettier . --write && yarn eslint .", | |||
"build": "yarn tsc --watch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually we name that one dev
, and not build.
usually, build
is build without watch
and dev
is build with watch.
also you have a watch command on line 36
[ | ||
{ | ||
mediaType: 'image', | ||
path: 'fixtures/test-image.png', | ||
attachmentType: 'media', | ||
}, | ||
{ | ||
mediaType: 'video', | ||
path: 'fixtures/test-video.mp4', | ||
attachmentType: 'media', | ||
}, | ||
{ | ||
mediaType: 'gif', | ||
path: 'fixtures/test-gif.gif', | ||
attachmentType: 'media', | ||
}, | ||
{ | ||
mediaType: 'document', | ||
path: 'fixtures/test-file.pdf', | ||
attachmentType: 'file', | ||
}, | ||
{ | ||
mediaType: 'voice', | ||
path: '', | ||
attachmentType: 'audio', | ||
}, | ||
].forEach(({ mediaType, path, attachmentType }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await sendMedia(aliceWindow1, path, testMessage); | ||
} | ||
// Click on untrusted attachment | ||
await trustUser(bobWindow1, alice.userName, attachmentType as MediaType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you make the attachmentType: 'document'
as const (and the others too), you should be able to get rid of that as MediaType. Let me know if not.
@@ -240,7 +242,7 @@ test_Alice_2W_Bob_1W( | |||
// Set disappearing messages to on | |||
await setDisappearingMessages( | |||
aliceWindow1, | |||
['1:1', 'disappear-after-send-option', 'time-option-10-seconds'], | |||
['1:1', 'disappear-after-send-option', 'time-option-10-seconds', 'sent'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems that you are not using that last item on the array in setDisappearingMessages.
Can you just get rid of it everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was waiting for the modal description to be merged before using this but it should be merged now
{ | ||
mediaType: 'video', | ||
path: 'fixtures/test-video.mp4', | ||
mediaTag: 'media', | ||
}, | ||
{ | ||
mediaType: 'gif', | ||
path: 'fixtures/test-gif.gif', | ||
mediaTag: 'media', | ||
}, | ||
{ | ||
mediaType: 'document', | ||
path: 'fixtures/test-file.pdf', | ||
mediaTag: 'file', | ||
}, | ||
{ | ||
mediaType: 'voice', | ||
path: '', | ||
mediaTag: 'audio', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could make those a constant and import the array in each testfile that needs to run the same tests.
i.e. this one and tests/automation/disappearing_message_checks.spec.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
// Click on untrusted attachment in window B | ||
await sleepFor(1000); | ||
await trustUser(bobWindow1, alice.userName, mediaTag as MediaType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as in tests/automation/disappearing_message_checks.spec.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
}; | ||
export const sendMessage = async (window: Page, message: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line before the export const please
await selc.click({ button: 'right' }); | ||
await clickOnMatchingText( | ||
senderWindow, | ||
englishStrippedStr('reply').toString(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure I had to add a sleepFor between the await selc.click and the clickOnMatchingText to avoid a layout shift. Could you add it too? Maybe 100ms should be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i couldn't remember how you solved the layout shift, but that seems to be have fixed it 👌
// Need test tag of modal-description for this to work | ||
// let action; | ||
// if (disappearAction) { | ||
// action = englishStrippedStr('disappearingMessagesTypeRead').toString(); | ||
// } else { | ||
// action = englishStrippedStr('disappearingMessagesTypeSent').toString(); | ||
// } | ||
|
||
// await checkModalStrings( | ||
// windowB, | ||
// englishStrippedStr('disappearingMessagesFollowSetting').toString(), | ||
// action, | ||
// ); | ||
await clickOnElement({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be merged now?
Send disappearing