Skip to content

Commit

Permalink
Merge branch 'dev' into sara/minor-update
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm authored Nov 7, 2023
2 parents 05b9b6b + 34f816a commit ee51a9e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/screenobjects/files/FilesScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,10 @@ export default class FilesScreen extends UplinkMainScreen {
}
}

async validateFileOrFolderExist(locator: string) {
async validateFileOrFolderExist(locator: string, timeout: number = 30000) {
const fileFolderElementLocator = await this.getLocatorOfFolderFile(locator);
const fileFolderElement = await this.instance.$(fileFolderElementLocator);
await fileFolderElement.waitForExist({ timeout: 30000 });
await fileFolderElement.waitForExist({ timeout: timeout });
}

async validateFileOrFolderNotExist(locator: string) {
Expand Down
23 changes: 16 additions & 7 deletions tests/specs/03-files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function files() {
const prereleaseIndicatorText =
await filesScreenFirstUser.prereleaseIndicatorText;
await expect(prereleaseIndicatorText).toHaveTextContaining(
"Pre-release | Issues/Feedback"
"Pre-release | Issues/Feedback",
);
});

Expand Down Expand Up @@ -177,7 +177,7 @@ export default async function files() {
await expect(filesInfoMaxSizeLabel).toHaveTextContaining("Max Size:");
await expect(filesInfoMaxSizeValue).toHaveTextContaining("1 GB");
await expect(filesInfoCurrentSizeLabel).toHaveTextContaining(
"Current Space:"
"Current Space:",
);
await expect(filesInfoCurrentSizeValue).toHaveTextContaining("0 bytes");
});
Expand All @@ -192,7 +192,10 @@ export default async function files() {
});

// Once that progress indicator disappears, validate that file is loaded
await filesScreenFirstUser.validateFileOrFolderExist("app-macos.zip");
await filesScreenFirstUser.validateFileOrFolderExist(
"app-macos.zip",
60000,
);

// Finally, ensure that file size indicators are updated
const filesInfoMaxSizeLabel =
Expand All @@ -206,7 +209,7 @@ export default async function files() {
await expect(filesInfoMaxSizeLabel).toHaveTextContaining("Max Size:");
await expect(filesInfoMaxSizeValue).toHaveTextContaining("1 GB");
await expect(filesInfoCurrentSizeLabel).toHaveTextContaining(
"Current Space:"
"Current Space:",
);
await expect(filesInfoCurrentSizeValue).toHaveTextContaining("13.2 MB");
});
Expand All @@ -221,7 +224,10 @@ export default async function files() {
});

// Once that progress indicator disappears, validate that file is loaded and is automatically renamed to avoid name conflicts
await filesScreenFirstUser.validateFileOrFolderExist("app-macos (1).zip");
await filesScreenFirstUser.validateFileOrFolderExist(
"app-macos (1).zip",
60000,
);
});

it("Files - Attempt to rename a file with existing file name", async () => {
Expand All @@ -235,7 +241,10 @@ export default async function files() {

// Type the previous filename for app-macos (1) so it can keep the original name. Ensure that file still exists in Screen
await filesScreenFirstUser.typeOnFileNameInput("app-macos (1)");
await filesScreenFirstUser.validateFileOrFolderExist("app-macos (1).zip");
await filesScreenFirstUser.validateFileOrFolderExist(
"app-macos (1).zip",
60000,
);
});

it("Files - Attempt to create a folder with empty name", async () => {
Expand All @@ -246,7 +255,7 @@ export default async function files() {
await filesScreenFirstUser.inputError.waitForExist();
const inputErrorText = await filesScreenFirstUser.inputErrorText;
await expect(inputErrorText).toHaveTextContaining(
"Please enter at least 1 character."
"Please enter at least 1 character.",
);

// Click again on Create Folder button to cancel operation
Expand Down

0 comments on commit ee51a9e

Please sign in to comment.