Skip to content

Commit

Permalink
test(update): fix for flakky test on mac ci of files create folder
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Oct 26, 2023
1 parent 95c1a87 commit b908b71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config/wdio.mac.ci.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ export const config: WebdriverIO.Config = {
// resolved to continue.
onPrepare: async function() {
const cacheFolder = homedir() + "/.uplink/.user";
const savedFile = join(process.cwd(), "./tests/fixtures/saved.jpg")
const allureResultsFolder = join(process.cwd(), "./allure-results");
const testReportFolder = join(process.cwd(), "./test-report");
const testResultsFolder = join(process.cwd(), "./test-results");
try {
await rmSync(allureResultsFolder, { recursive: true, force: true });
await rmSync(savedFile, { recursive: true, force: true });
await rmSync(testReportFolder, { recursive: true, force: true });
await rmSync(testResultsFolder, { recursive: true, force: true });
console.log("Deleted Artifacts Folders Successfully!");
Expand Down
7 changes: 3 additions & 4 deletions tests/screenobjects/files/FilesScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export default class FilesScreen extends UplinkMainScreen {
async clickOnCreateFolder() {
const addFolderButton = await this.addFolderButton;
await addFolderButton.click();
await this.inputFolderFileName.waitForExist();
}

async clickOnFileOrFolder(locator: string) {
Expand Down Expand Up @@ -354,7 +355,6 @@ export default class FilesScreen extends UplinkMainScreen {
const currentDriver = await this.getCurrentDriver();
await this.clickOnCreateFolder();
const inputFolderFileName = await this.inputFolderFileName;
await inputFolderFileName.waitForExist();
if (currentDriver === MACOS_DRIVER) {
await inputFolderFileName.addValue("\n");
} else if (currentDriver === WINDOWS_DRIVER) {
Expand All @@ -364,10 +364,9 @@ export default class FilesScreen extends UplinkMainScreen {

async createFolder(name: string) {
await this.clickOnCreateFolder();
const filesInfoCurrentSizeLabel = await this.filesInfoCurrentSizeLabel;
const inputFolderFileName = await this.inputFolderFileName;
await inputFolderFileName.waitForExist();
await inputFolderFileName.setValue(name);
const filesInfoCurrentSizeLabel = await this.filesInfoCurrentSizeLabel;
await this.inputFolderFileName.setValue(name);
// Retry typing if appium fails on type
const inputValue = await inputFolderFileName.getText();
if (inputValue !== name) {
Expand Down

0 comments on commit b908b71

Please sign in to comment.