Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runOnAndroid/runOnIOS blocks are stuck after upgrading CodeCept from 3.4.1 to 3.5.15 and Appium From 1 to 2. #4266

Closed
kiran-yara opened this issue Mar 22, 2024 · 9 comments · Fixed by #4525

Comments

@kiran-yara
Copy link

What are you trying to achieve?

We recently upgraded from 3.4.1 to 3.5.15 and from Appium 1 to Appium 2.

What do you get instead?

After the upgrade our scripts started failing inside runOnAndroid/runOnIOS. Failing as in scripts are stuck and dont proceed after default timeout Broswerstack execution is auto killed and scripts stay stuck.
Please note if I revert back to 3.4.1 and Appium 1 it works as expected

Console output if related.
Not Applicable as no output is getting printed

        I.runOnAndroid(() => {
            I.waitForElement('Invalid phone number, please try again', 120)
            I.seeElement('Invalid phone number, please try again')
        });
        I.runOnIOS(() => {
            I.waitForElement('Incorrect number Please try again', 120)
            I.seeElement('Incorrect number Please try again')
        });

Details

  • CodeceptJS version: 3.5.15
  • NodeJS Version: v16.15.1
  • Operating System: ANdroid/iOS/Mac Ventura 13
  • webdriverio: 8.32.0
  • Configuration file:
exports.config = {
    tests: testPath,
    output: '../output',
    timeout: 10000,
    
    helpers: {
        Appium: {
            appiumV2: true,
            host: "hub-cloud.browserstack.com",
            port: 4444,
            user: process.env.YC_BS_USER,
            key: process.env.YC_BS_KEY,
            platform : "android",
            desiredCapabilities: {
              "platformName" : "android",
              "platformVersion" : "10.0",
              "deviceName" : "OnePlus 8",
              "app" : "bs://XXXXXX",
              'bstack:options' : {
                userName : process.env.YC_BS_USER,
                accessKey : process.env.YC_BS_KEY,
                "appiumVersion":"2.4.1",
                "projectName" : "YaraConnect",
              }
            }
        },
      BrowserStackAppAutomate: {
          require: "../tests/helpers/browserStackAppAutomateHelper.js",
          user: process.env.YC_BS_USER,
          key: process.env.YC_BS_KEY,
      },
      AppiumHelper: {
          require: "../tests/helpers/appiumHelper.js",
      },
      REST: {},
      DbHelper: {
          require: "../tests/helpers/dbConnectHelper.js"
      },
      AllureDebugHelper: {
          require: '../tests/helpers/AllureDebugHelper.js',
      }
    },
    include: pageObjects,
    bootstrap: null,
    mocha: {},
    name: 'yc-global-e2e',
    plugins: {
        pauseOnFail: {},
        retryFailedStep: {
            enabled: true
        },
        screenshotOnFail: {
            enabled: true
        },
        tryTo: {
            enabled: true
        },
        allure: {
          outputDir:'allure-results',
          enabled: true,
          require: '@codeceptjs/allure-legacy',
        }
    }
}
@npusnik
Copy link

npusnik commented May 20, 2024

I have encountered the same issue when upgrading codeceptjs to the latest version (from 3.4.1 to currently latest @3.6.2). This is a very critical bug that needs to be fixed as older versions of Codeceptjs (3.5.0 and under) do no contain the fix for touch/perform actions - they always fail with webdriver 404 error. 3.6.2 on the other hand is able to process touch perform action. This way, I have to choose between runOnIOS / runOnAndroid function OR touch/perform actions which are both very needed. Please fix this issue 🙏

@kobenguyent
Copy link
Collaborator

Screenshot 2024-08-13 at 16 31 20
our Android tests work fine with runOnAndroid, may you try with latest version?

@npusnik
Copy link

npusnik commented Sep 17, 2024

Hi @kobenguyent, I’ve updated all drivers and frameworks to their latest stable versions and tested again. Unfortunately, the issue persists with any runOnAndroid or runOniOS function I attempt to execute.

Here are the versions I am currently using:

CodeceptJS v3.6.5
Appium v2.6.0

@kobenguyent
Copy link
Collaborator

Hi @kobenguyent, I’ve updated all drivers and frameworks to their latest stable versions and tested again. Unfortunately, the issue persists with any runOnAndroid or runOniOS function I attempt to execute.

Here are the versions I am currently using:

CodeceptJS v3.6.5 Appium v2.6.0

just noticed your wdio is a bit old, maybe that the issue? Currently codeceptjs is using v8.x https://github.com/codeceptjs/CodeceptJS/blob/3.x/package.json#L172

@npusnik
Copy link

npusnik commented Oct 24, 2024

@kobenguyent I've updated wdio to @8.14.0
I then updated codeceptJS to the latest @3.6.6 and the result is the same - runOnIOS() and runOnAndroid() won't exit. DOwngrading back to codeceptJS @3.5.0 resolves the issue.

@kobenguyent
Copy link
Collaborator

hey @npusnik not sure if this is the side effect of this fix https://github.com/codeceptjs/CodeceptJS/pull/4018/files

@kobenguyent
Copy link
Collaborator

@npusnik please try this https://www.npmjs.com/package/codeceptjs/v/3.6.8-beta.1 to see whether it resolves your issue.

@npusnik
Copy link

npusnik commented Oct 25, 2024

@kobenguyent just tried this beta version you've suggested and damn, it works better then ever before. Much faster too. Thanks for the help!
@kiran-yara can you try it out and confirm it works for you as well?

@kobenguyent
Copy link
Collaborator

@kobenguyent just tried this beta version you've suggested and damn, it works better then ever before. Much faster too. Thanks for the help!

@kiran-yara can you try it out and confirm it works for you as well?

Thanks for your tests. So sounds like it's likely an issue of superfluous async/await in the code flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants