Skip to content

Commit

Permalink
Merge pull request #679 from Satellite-im/luis/permissions
Browse files Browse the repository at this point in the history
test(update): fix permissions microphone message displayed on first open
  • Loading branch information
luisecm authored Apr 12, 2024
2 parents 40c1757 + 3ac8159 commit 0357962
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 36 deletions.
4 changes: 0 additions & 4 deletions tests/helpers/commandsNewUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,4 @@ export async function createNewUser(

// Ensure Main Screen is displayed
await WelcomeScreen.welcomeLayout.waitForExist({ timeout: 60000 });

// Workaround to ensure that user clicks on Add Someone
await WelcomeScreen.clickAddSomeone();
await FriendsScreen.friendsBody.waitForExist();
}
2 changes: 1 addition & 1 deletion tests/helpers/debugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ export async function setupBeforeCreateGroupTests() {

export async function setupBeforeSettingsTests() {
await createNewUser("Test123");
await FriendsScreen.goToSettings();
await WelcomeScreen.goToSettings();
await SettingsProfileScreen.waitForIsShown(true);
}
46 changes: 46 additions & 0 deletions tests/specs/reusable-accounts/00-create-three-instances.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require("module-alias/register");
import { createNewUser } from "@helpers/commandsNewUser";
import {
closeFirstApplication,
closeSecondApplication,
closeThirdApplication,
launchSecondApplication,
launchThirdApplication,
} from "@helpers/commands";
import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen";
import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen";

export default async function createChatAccountsTests() {
it("Chats Tests - Create account for first instance", async () => {
// Launch first application and Create a new account to show Welcome Screen
await CreatePinScreen.waitForIsShown(true);
const username = "ChatUserA";
await createNewUser(username);
await WelcomeScreen.waitForIsShown(true);

// Close first application
await closeFirstApplication();
});

it("Chats Tests - Create account for second instance", async () => {
// Launch second application and Create a new account to show Welcome Screen
await launchSecondApplication();
await CreatePinScreen.waitForIsShown(true);
await createNewUser("ChatUserB");
await WelcomeScreen.waitForIsShown(true);

// Close second application
await closeSecondApplication();
});

it("Chats Tests - Create account for third instance", async () => {
// Launch third application and Create a new account to show Welcome Screen
await launchThirdApplication();
await CreatePinScreen.waitForIsShown(true);
await createNewUser("ChatUserC");
await WelcomeScreen.waitForIsShown(true);

// Close third application
await closeThirdApplication();
});
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require("module-alias/register");
import { createNewUser } from "@helpers/commandsNewUser";
import {
activateFirstApplication,
activateSecondApplication,
closeFirstApplication,
closeSecondApplication,
getUserKey,
launchFirstApplication,
launchSecondApplication,
saveTestKeys,
scrollDown,
Expand All @@ -28,12 +28,17 @@ import SettingsNotificationsScreen from "@screenobjects/settings/SettingsNotific
import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen";
import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen";

export default async function createChatAccountsTests() {
export default async function chatsFriendsRequests() {
before(async () => {
await launchSecondApplication();
await CreatePinScreen.loginWithTestUser();
await launchFirstApplication();
await CreatePinScreen.loginWithTestUser();
});

it("Chat User A - Create Account", async () => {
// Create a new account and go to Settings Profile
await CreatePinScreen.waitForIsShown(true);
// Continue setting up first account created
const username = "ChatUserA";
await createNewUser(username);
await WelcomeScreen.goToSettings();
await SettingsProfileScreen.validateSettingsProfileIsShown();

Expand Down Expand Up @@ -99,16 +104,9 @@ export default async function createChatAccountsTests() {
await FriendsScreen.validateFriendsScreenIsShown();
});

it("Chat User B - Create Account", async () => {
// Launch second application
await launchSecondApplication();

// Create a new account and go to Settings Profile
await CreatePinScreen.waitForIsShown(true);
await createNewUser("ChatUserB");
});

it("Chat User B - Save Did Key from User", async () => {
// Activate second application and continue setting up second account
await activateSecondApplication();
await WelcomeScreen.goToSettings();
await SettingsProfileScreen.validateSettingsProfileIsShown();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import SettingsGeneralScreen from "@screenobjects/settings/SettingsGeneralScreen
import SettingsNotificationsScreen from "@screenobjects/settings/SettingsNotificationsScreen";
import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen";
import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen";
import { createNewUser } from "@helpers/commandsNewUser";
import {
activateFirstApplication,
activateThirdApplication,
Expand All @@ -25,16 +24,12 @@ export default async function groupChatMultipleUsersTests() {
before(async () => {
await launchFirstApplication();
await CreatePinScreen.loginWithTestUser();
await launchThirdApplication();
await CreatePinScreen.loginWithTestUser();
});

it("Chat User C - Create Account", async () => {
// Launch third application
await launchThirdApplication();

// Create a new account and go to Settings Profile
await CreatePinScreen.waitForIsShown(true);
const username = "ChatUserC";
await createNewUser(username);
// Continue setting up third account
await WelcomeScreen.goToSettings();
await SettingsProfileScreen.validateSettingsProfileIsShown();

Expand All @@ -53,7 +48,7 @@ export default async function groupChatMultipleUsersTests() {

// Grab cache folder and restart
const didkey = await SettingsProfileScreen.getCopiedDidFromStatusInput();
await saveTestKeys(username, didkey);
await saveTestKeys("ChatUserC", didkey);
await SettingsProfileScreen.deleteStatus();
});

Expand Down
18 changes: 10 additions & 8 deletions tests/suites/Chats/01-Chats.suite.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
require("module-alias/register");
import chatTopbarTests from "@specs/reusable-accounts/06-chat-topbar.spec";
import createChatAccountsTests from "@specs/reusable-accounts/01-create-accounts-and-friends.spec";
import groupChatTests from "@specs/reusable-accounts/09-group-chats.spec";
import groupChatEditTests from "@specs/reusable-accounts/10-group-chats-edit.spec";
import groupChatSidebarTests from "@specs/reusable-accounts/11-group-chats-sidebar.spec";
import messageAttachmentsTests from "@specs/reusable-accounts/05-message-attachments.spec";
import createChatAccountsTests from "@specs/reusable-accounts/00-create-three-instances.spec";
import chatsFriendsRequests from "@specs/reusable-accounts/01-create-accounts-and-friends.spec";
import repliesTests from "@specs/reusable-accounts/02-chat-replies.spec";
import messageContextMenuTests from "@specs/reusable-accounts/03-message-context-menu.spec";
import messageInputTests from "@specs/reusable-accounts/04-message-input.spec";
import repliesTests from "@specs/reusable-accounts/02-chat-replies.spec";
import messageAttachmentsTests from "@specs/reusable-accounts/05-message-attachments.spec";
import chatTopbarTests from "@specs/reusable-accounts/06-chat-topbar.spec";
import quickProfileTests from "@specs/reusable-accounts/07-quick-profile.spec";
import sidebarChatsTests from "@specs/reusable-accounts/08-sidebar-chats.spec";
import groupChatTests from "@specs/reusable-accounts/09-group-chats.spec";
import groupChatEditTests from "@specs/reusable-accounts/10-group-chats-edit.spec";
import groupChatSidebarTests from "@specs/reusable-accounts/11-group-chats-sidebar.spec";
import groupChatMultipleUsersTests from "@specs/reusable-accounts/12-group-chats-multiple-users.spec";

describe("Create Accounts and Chat Tests", createChatAccountsTests.bind(this));
describe("Create Accounts for Chats Tests", createChatAccountsTests.bind(this));
describe("Friend Requests and Messages Tests", chatsFriendsRequests.bind(this));
describe("Chat Replies Tests", repliesTests.bind(this));
describe("Message Context Menu Tests", messageContextMenuTests.bind(this));
describe("Message Input Tests", messageInputTests.bind(this));
Expand Down

0 comments on commit 0357962

Please sign in to comment.