Skip to content
Draft
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
1 change: 0 additions & 1 deletion examples/E2ETestApp/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ test names and expectations. Where the SDK disagrees with the native expectation
grouped channel lists, channel/message/member search, reminders, push notifications (app-level in RN), Android's
`BackendTests` (real backend), hard delete from the message menu, iOS read counts and the iOS scroll performance tests.
Tests that cut the network run only on Android (`itOnAndroid`): the iOS simulator shares the Mac's connection.
Tests that take the Android CI emulator down run only on iOS (`itOnIOS`), with a comment linking the ticket.

## Impact analysis

Expand Down
14 changes: 10 additions & 4 deletions examples/E2ETestApp/e2e/robots/UserRobotMessageListAsserts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,16 @@ UserRobot.prototype.assertMessageDeliveryStatus = function (status, count) {
case MessageDeliveryStatus.FAILED:
return assertFailedIcon(true, count);
case MessageDeliveryStatus.NIL:
await assertVisibility(Message.deliveryStatusIsRead, false);
await assertVisibility(Message.deliveryStatusIsDelivered, false);
await assertVisibility(Message.deliveryStatusIsPending, false);
await assertVisibility(Message.deliveryStatusIsSent, false);
// Only the list's message cells: a thread's parent message sits above the replies outside
// any cell (ThreadFooterComponent) and shows its own status.
for (const status of [
Message.deliveryStatusIsRead,
Message.deliveryStatusIsDelivered,
Message.deliveryStatusIsPending,
Message.deliveryStatusIsSent,
]) {
await assertVisibility(status.withAncestor(MessageList.messages), false);
}
return;
default:
throw new Error(`Unsupported delivery status: ${status}`);
Expand Down
7 changes: 0 additions & 7 deletions examples/E2ETestApp/e2e/support/StreamTestCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ export const itOnAndroid: typeof it = ((name: string, fn: () => Promise<void>, t
? it(name, fn, timeout)
: it.skip(name, fn, timeout)) as typeof it;

/**
* `it` on iOS, `it.skip` on Android: for tests that take the Android CI emulator down with them
* (RN-513). Name the ticket in a comment above each one.
*/
export const itOnIOS: typeof it = ((name: string, fn: () => Promise<void>, timeout?: number) =>
device.getPlatform() === 'ios' ? it(name, fn, timeout) : it.skip(name, fn, timeout)) as typeof it;

/**
* `it`, except `it.skip` on iOS below 18: for tests that hit an SDK bug only older iOS versions
* show. Name the ticket in a comment above each one. Runs when the version can't be read.
Expand Down
29 changes: 10 additions & 19 deletions examples/E2ETestApp/e2e/tests/GiphyTests.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { describe, it } from '@jest/globals';

import { MessageDeliveryStatus } from '../mock-server/DataTypes';
import { allureId, step } from '../support/step';
import { itOnIOS, setUpStreamTestCase } from '../support/StreamTestCase';
import { setUpStreamTestCase } from '../support/StreamTestCase';

describe('GiphyTests', () => {
const { backendRobot, participantRobot, userRobot } = setUpStreamTestCase();

// https://linear.app/stream/issue/RN-513
itOnIOS('test_userObservesAnimatedGiphy_whenUserAddsGiphyMessage', async () => {
it('test_userObservesAnimatedGiphy_whenUserAddsGiphyMessage', async () => {
allureId(13081);
await step('GIVEN user opens a channel', () => userRobot.login().openChannel());
await step('WHEN user sends a giphy using giphy command', () => userRobot.uploadGiphy());
Expand All @@ -17,16 +16,14 @@ describe('GiphyTests', () => {
);
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_userObservesAnimatedGiphy_whenParticipantAddsGiphyMessage', async () => {
it('test_userObservesAnimatedGiphy_whenParticipantAddsGiphyMessage', async () => {
allureId(13082);
await step('GIVEN user opens a channel', () => userRobot.login().openChannel());
await step('WHEN participant sends a giphy', () => participantRobot.uploadGiphy());
await step('THEN user observes the animated gif', () => userRobot.assertGiphyImage());
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_userObservesAnimatedGiphy_whenUserAddsGiphyMessageInThread', async () => {
it('test_userObservesAnimatedGiphy_whenUserAddsGiphyMessageInThread', async () => {
allureId(13083);
await step('GIVEN user opens a channel', async () => {
await backendRobot.generateChannels({ channelsCount: 1, messagesCount: 1 });
Expand All @@ -38,8 +35,7 @@ describe('GiphyTests', () => {
await step('THEN user observes the animated gif in thread', () => userRobot.assertGiphyImage());
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_userObservesAnimatedGiphy_whenParticipantAddsGiphyMessageInThread', async () => {
it('test_userObservesAnimatedGiphy_whenParticipantAddsGiphyMessageInThread', async () => {
allureId(13084);
await step('GIVEN user opens a channel', async () => {
await backendRobot.generateChannels({ channelsCount: 1, messagesCount: 1 });
Expand All @@ -54,8 +50,7 @@ describe('GiphyTests', () => {
);
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_userObservesAnimatedGiphy_afterAddingGiphyThroughComposerMenu', async () => {
it('test_userObservesAnimatedGiphy_afterAddingGiphyThroughComposerMenu', async () => {
allureId(13085);
await step('GIVEN user opens a channel', () => userRobot.login().openChannel());
await step('WHEN user sends a giphy using the command suggestions', () =>
Expand All @@ -64,8 +59,7 @@ describe('GiphyTests', () => {
await step('THEN user observes the animated gif', () => userRobot.assertGiphyImage());
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_userObservesAnimatedGiphy_whenUserAddsGiphyMessage_AfterShuffling', async () => {
it('test_userObservesAnimatedGiphy_whenUserAddsGiphyMessage_AfterShuffling', async () => {
allureId(13086);
await step('GIVEN user opens a channel', () => userRobot.login().openChannel());
await step('WHEN user shuffles a giphy', () =>
Expand All @@ -80,8 +74,7 @@ describe('GiphyTests', () => {
);
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_messageIsNotSent_whenUserCancelsEphemeralMessage', async () => {
it('test_messageIsNotSent_whenUserCancelsEphemeralMessage', async () => {
allureId(13087);
await step('GIVEN user opens a channel', () => userRobot.login().openChannel());
await step('WHEN user cancels a giphy', () =>
Expand Down Expand Up @@ -126,8 +119,7 @@ describe('GiphyTests', () => {
);
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_deliveryStatusHidden_whenEphemeralMessageShown', async () => {
it('test_deliveryStatusHidden_whenEphemeralMessageShown', async () => {
allureId(13090);
await step('GIVEN user opens a channel', () => userRobot.login().openChannel());
await step('WHEN user runs a giphy command', () =>
Expand All @@ -140,8 +132,7 @@ describe('GiphyTests', () => {
);
});

// https://linear.app/stream/issue/RN-513
itOnIOS('test_deliveryStatusHidden_whenEphemeralMessageShownInThread', async () => {
it('test_deliveryStatusHidden_whenEphemeralMessageShownInThread', async () => {
allureId(13091);
await step('GIVEN user opens a channel', async () => {
await backendRobot.generateChannels({ channelsCount: 1, messagesCount: 1 });
Expand Down
8 changes: 4 additions & 4 deletions examples/SampleApp/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ lane :e2e_check_required do
end

# `<test file>/<test>` ids of the tests that can run, e.g. `MessageListTests.e2e/test_x`: the coverage
# map's keys. `it.skip` tests are left out; `itOnAndroid`, `itOnIOS` and `itExceptOnOldIOS` ones are
# in (Jest skips them where they don't run).
# map's keys. `it.skip` tests are left out; `itOnAndroid` and `itExceptOnOldIOS` ones are in (Jest
# skips them where they don't run).
def e2e_test_ids(tests_path)
Dir.glob(File.join(tests_path, '*.e2e.ts')).sort.flat_map do |file|
source = File.read(file)
calls = source.scan(/^\s*(?:it|itOnAndroid|itOnIOS|itExceptOnOldIOS)(?:\.skip)?\(/).size
tests = source.scan(/^\s*(?:it|itOnAndroid|itOnIOS|itExceptOnOldIOS)(\.skip)?\(\s*'(test_\w+)'/)
calls = source.scan(/^\s*(?:it|itOnAndroid|itExceptOnOldIOS)(?:\.skip)?\(/).size
tests = source.scan(/^\s*(?:it|itOnAndroid|itExceptOnOldIOS)(\.skip)?\(\s*'(test_\w+)'/)
# A test this misses would never run on a pull request, so fail loudly instead.
UI.user_error!("#{file}: read #{tests.size} of its #{calls} tests; name each one with a `test_*` literal") if tests.size != calls

Expand Down
Loading