Skip to content

Commit c9987d2

Browse files
committed
fix: rename allure step
1 parent 212fa37 commit c9987d2

File tree

2 files changed

+48
-36
lines changed

2 files changed

+48
-36
lines changed
Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import type { TestInfo } from '@playwright/test';
1+
import { test, type TestInfo } from '@playwright/test';
22

33
import { englishStrippedStr } from '../../localizer/englishStrippedStr';
4+
import { TestSteps } from '../../types/allure';
45
import { bothPlatformsIt } from '../../types/sessionIt';
56
import { DisappearActions, DISAPPEARING_TIMES } from '../../types/testing';
67
import { MessageBody } from './locators/conversation';
@@ -27,42 +28,53 @@ async function disappearAfterSendGroups(platform: SupportedPlatformsType, testIn
2728
const controlMode: DisappearActions = 'sent';
2829
const time = DISAPPEARING_TIMES.THIRTY_SECONDS;
2930
const maxWait = 35_000; // 30s plus buffer
31+
let sentTimestamp: number;
3032
const {
3133
devices: { alice1, bob1, charlie1 },
3234
prebuilt: { alice },
33-
} = await open_Alice1_Bob1_Charlie1_friends_group({
34-
platform,
35-
groupName: testGroupName,
36-
focusGroupConvo: true,
37-
testInfo,
35+
} = await test.step(TestSteps.SETUP.QA_SEEDER, async () => {
36+
return open_Alice1_Bob1_Charlie1_friends_group({
37+
platform,
38+
groupName: testGroupName,
39+
focusGroupConvo: true,
40+
testInfo,
41+
});
42+
});
43+
await test.step(TestSteps.DISAPPEARING_MESSAGES.SET(time), async () => {
44+
await setDisappearingMessage(platform, alice1, ['Group', `Disappear after send option`, time]);
45+
});
46+
await test.step(TestSteps.VERIFY.DISAPPEARING_CONTROL_MESSAGES, async () => {
47+
// Get correct control message for You setting disappearing messages
48+
const disappearingMessagesSetYou = englishStrippedStr('disappearingMessagesSetYou')
49+
.withArgs({ time, disappearing_messages_type: controlMode })
50+
.toString();
51+
// Get correct control message for alice setting disappearing messages
52+
const disappearingMessagesSetControl = englishStrippedStr('disappearingMessagesSet')
53+
.withArgs({ name: alice.userName, time, disappearing_messages_type: controlMode })
54+
.toString();
55+
// Check control message is correct on device 1, 2 and 3
56+
await Promise.all([
57+
alice1.waitForControlMessageToBePresent(disappearingMessagesSetYou),
58+
bob1.waitForControlMessageToBePresent(disappearingMessagesSetControl),
59+
charlie1.waitForControlMessageToBePresent(disappearingMessagesSetControl),
60+
]);
3861
});
39-
40-
await setDisappearingMessage(platform, alice1, ['Group', `Disappear after send option`, time]);
41-
// Get correct control message for You setting disappearing messages
42-
const disappearingMessagesSetYou = englishStrippedStr('disappearingMessagesSetYou')
43-
.withArgs({ time, disappearing_messages_type: controlMode })
44-
.toString();
45-
// Get correct control message for alice setting disappearing messages
46-
const disappearingMessagesSetControl = englishStrippedStr('disappearingMessagesSet')
47-
.withArgs({ name: alice.userName, time, disappearing_messages_type: controlMode })
48-
.toString();
49-
// Check control message is correct on device 1, 2 and 3
50-
await Promise.all([
51-
alice1.waitForControlMessageToBePresent(disappearingMessagesSetYou),
52-
bob1.waitForControlMessageToBePresent(disappearingMessagesSetControl),
53-
charlie1.waitForControlMessageToBePresent(disappearingMessagesSetControl),
54-
]);
5562
// Check for test messages (should be deleted)
56-
const sentTimestamp = await alice1.sendMessage(testMessage);
57-
await Promise.all(
58-
[alice1, bob1, charlie1].map(device =>
59-
device.hasElementDisappeared({
60-
...new MessageBody(device, testMessage).build(),
61-
maxWait,
62-
actualStartTime: sentTimestamp,
63-
})
64-
)
65-
);
66-
// Close server and devices
67-
await closeApp(alice1, bob1, charlie1);
63+
await test.step(TestSteps.SEND.MESSAGE(alice.userName, testGroupName), async () => {
64+
sentTimestamp = await alice1.sendMessage(testMessage);
65+
});
66+
await test.step(TestSteps.VERIFY.MESSAGE_DISAPPEARED, async () => {
67+
await Promise.all(
68+
[alice1, bob1, charlie1].map(device =>
69+
device.hasElementDisappeared({
70+
...new MessageBody(device, testMessage).build(),
71+
maxWait,
72+
actualStartTime: sentTimestamp,
73+
})
74+
)
75+
);
76+
});
77+
await test.step(TestSteps.SETUP.CLOSE_APP, async () => {
78+
await closeApp(alice1, bob1, charlie1);
79+
});
6880
}

run/test/specs/disappearing_link.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function disappearingLinkMessage1o1Ios(platform: SupportedPlatformsType, t
4949
testInfo,
5050
});
5151
});
52-
await test.step(TestSteps.DISAPPEARING_MESSAGES.SET_DISAPPEARING_MSG, async () => {
52+
await test.step(TestSteps.DISAPPEARING_MESSAGES.SET(time), async () => {
5353
await setDisappearingMessage(platform, alice1, ['1:1', timerType, time], bob1);
5454
});
5555
await test.step(TestSteps.SEND.LINK, async () => {
@@ -103,7 +103,7 @@ async function disappearingLinkMessage1o1Android(
103103
testInfo,
104104
});
105105
});
106-
await test.step(TestSteps.DISAPPEARING_MESSAGES.SET_DISAPPEARING_MSG, async () => {
106+
await test.step(TestSteps.DISAPPEARING_MESSAGES.SET(time), async () => {
107107
await setDisappearingMessage(platform, alice1, ['1:1', timerType, time]);
108108
});
109109
await test.step(TestSteps.SEND.LINK, async () => {

0 commit comments

Comments
 (0)