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

Native app session not started with appium:app behaves as web session and fails #333

Closed
wswebcreation opened this issue May 15, 2024 · 1 comment · Fixed by #325
Closed
Assignees
Labels
bug Something isn't working

Comments

@wswebcreation
Copy link
Member

wswebcreation commented May 15, 2024

Describe the bug
Native app session not started with appium:app behaves as web session and fails.

To Reproduce
Start a session that uses an already installed app

Workaround:
Start the session and add this command to your

export const config = {
    // ......   
    beforeSuite: async function () {
        // https://webdriver.io/docs/api/appium/#getcontext
        // This will get the current context and if it's native it will internally switch to the native module context
        await driver.getContext()
    },
}

Potentail solution
Update the determineNativeContext method and check:

  • for Android if it's not a browser and if the appium:appPackage is provided
  • for iOS if it's not a browser and if the appium:bundleId is provided

which means it's native context

@wswebcreation wswebcreation added the bug Something isn't working label May 15, 2024
@wswebcreation wswebcreation self-assigned this May 15, 2024
wswebcreation added a commit that referenced this issue May 22, 2024
@wswebcreation
Copy link
Member Author

This will be fixed in #325

wswebcreation added a commit that referenced this issue May 23, 2024
* feat: initial commit

- add ocrGetText command

* test: fix UTs

* feat: add system installed tesseract support

- update deps

* feat: add ocrGetElementPositionByText

* feat: add ocrClickOnText

* feat: add ocrSetValue

* feat: add ocrWaitForTextDisplayed

* chore: initial refactor of code

* feat: add fuzzyFindOptions to ocrWaitForTextDisplayed

* chore: optimize service code

* tesT: update e2e test

* feat: add contrast as a configurable option

* chore: fix some small things

* test: fix tests due to an issue with Canvas

* feat: draw a target where the app will be clicked

- return filepath

* feat: add target and search on words

- refactor code a bit
- fix properly cropping

* test: add E2E test

* chore: refactor adding highlights

- completely remove the node-canvas dependency to draw OCR images

* test: remove only

* feat: add haystack as coordinates

- change element to haystack

* test: add first UT

* test: add more test to single UT

* test: add new UT ocrGetElementPositionByText

* test: add test for ocrGetText

* test: add ocrSetValue tests

* test: add ocrWaitForTextDisplayed tests

* test: add fuzzy tests

- restructure tests

* chore: add all mocks for fuzzy

* test: add tests for image processing

* test: add index utils tests

* test: add ocrGetData tests

* test: add ocrGetTextPositions tests

* chore: remove double words

* chore: revert eslint to 8 again

* test: add ocrKeys uts

* test: add tests for tesseract file

* fix: fix issue 286

- the matcher only allowed an exact percentage, now it's lower or equal
- updated error message

* feat: add cli option

* chore: add changeset

* chore: change service name

* feat: add a separate service for OCR

* chore: revert changes to the visual service

* feat: add cli to ocr-service

* chore: remove cli command from visual service

* chore: update release

* chore: updates after feedback

* chore: update changelog

* test: add service UTs

* fix: fix parsing issues

returned text from system tesseract had unescaped txt in the result which resulted in a parsing error, now the text is abstracted differently

* chore: update deps and add SL OCR tests

* test: fix tests for running on Sauce

* test: add chrome with darkmode for better text recognition

* fix: update cli

* test: add CH action step

* chore: fix ut

* fix: fix tesseract text response for the js version

* test: update chrome baseline

* fix: fix issue #333

* chore: update release notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant