Giter Club home page Giter Club logo

canopy.mobile's People

Contributors

forki avatar lefthandedgoat avatar part-timedev avatar sergey-tihon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canopy.mobile's Issues

Canopy.Mobile can't find any selectors on a website

Description

On a website, I tried to:

  • "read" the title of the page with selector "h1"
  • "write" into the location field with selector "#Location"
  • "click" a search button "button.btn.btn-primary"
    But Canopy.Mobile throws exception that the element can't be found on the page.

Repro steps

  1. Open up any browser on an Android emulator
  2. Load a website (ex: https://www.commercialcafe.com/)
  3. Try to Read , Click or Write any selector.

Expected behavior

Does Canopy.Mobile work only for mobile applications?
I would expect to be able to use it for websites automation too.

Actual behavior

canopy.mobile.Exceptions.CanopyException was unhandled by user code
Message: An exception of type 'canopy.mobile.Exceptions.CanopyException' occurred in canopy.mobile.dll but was not handled in user code
Additional information: Failed to click "#Location", because it could not be found.
Did you mean?:
["Boston"; "Houston"; "button"; "section"; "Austin"]

Related information

  • Operating system: Android emulator (v6.0)
  • Browser: Internet and Chrome

Canopy.Mobile - BrowserStackSupport

Description

Is there a cloud based (browserStack) type connectivity support for Canopy.Mobile ?

Below is from BrowserStack.com

"
Testing mobile applications on real devices is a must. Even Google and Apple recommend doing so before submitting apps on the Google Play and App store.

An optimal way to get maximum coverage is to use a cloud-based testing product like BrowserStack, which provides access to 2000+ real devices across iOS and Android.
"

Thanks.

Can we write tests using C# ?

I have seen the web tests for canopy using C#. is it possible to write tests for mobile development also using C# ?

Take Screenshot when "find" fails

When a find operation times out we should capture a screenshot and trace other avaliable elements.
@lefthandedgoat is there already a special way how canopy proper does it? I personally would use a configuration variable for the path and just activate this by default. It's probably also important to trace other elements that we can find on the page.

@part-timeDev this is particularly important on the CI. Do we already know if we can tell gitlab that we have special artifacts?

Design discussion: API

canopy was the first major piece of code that I wrote in F#. At the time I was not aware that you were supposed to shy away from infix operators. I used them for a reason though. After contributing to a different 'English style' DSL for web testing, and working with the less technical QA folks, I realized that English didn't make the code easier for them to write, it made it harder. They wanted to phrase sentences in the way they want to, and not what was legit code.

I chose to use infix operators because they would be foreign to the QA people and I could simply tell them to memorize these few funky characters to do specific operations. No confusion with English terms anymore.

I also provide equals a b as an alternative to a == b for those that prefer it, but I don't think many use them.

I guess the question is, should you keep the infix operators, move away from them, or support both.

ClickAndWait should check wait selector before clicking

In order to fight flakiness we have clickAndWait helpers that take one selector to click and one to wait for after the click. In order to make it more useful in real world scenarios we should check that the wait selector does not match before we click. Otherwise we would not detect it page transitions

Running on physical device

Can this be run against a physical device?
I see AVD in the configuration, suggesting it only runs with simulators for now.

Stuck trying to run build.cmd

259fa0d#diff-6074983490330a0aac1bd23c958232d7R89

You switched from "sdk" to "android-sdk". I had a sdk folder but not android-sdk folder. It does not work with just sdk either.

I installed with the latest Android Studio package. Is there something else I need to install? I also created a hello world app, and installed API 23 (Marshmellow I think) and created an emulate for Nexus 6 because it seemed to be breaking on Nexus_6_23 and it launches from the IDE, and I get beyond that error now.

Here is the trace of where it is failing when I modify the path back to sdk fyi:

Finished Target: InstallAppium
Starting Target: RunTests (==> InstallAppium)
C:\projects\Canopy.Mobile\tests\Canopy.Mobile.Tests\bin\Release\Canopy.Mobile.Tests.exe --sequential
app C:\projects\Canopy.Mobile\tests\Canopy.Mobile.Tests\bin\Release\temp\ApiDemos-debug.apk already exists
Error: Environment variable HOME is not set.

Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at canopy.mobile.core.quit() in C:\projects\Canopy.Mobile\src\Canopy.Mobile\Canopy.Mobile.fs:line 93
   at Canopy.Mobile.Tests.main(String[] args) in C:\projects\Canopy.Mobile\tests\Canopy.Mobile.Tests\SampleTests.fs:line 127

Design discussion: Parallel test run support

canopy can only run tests in one browser at a time because it uses a global mutable instance of the browser. It makes the api really nice but more advanced users want to run more than one test at the same time.

The easiest way for them to do this is to simply parameterize their console app to run a subset of tests, or with different browsers, and run the console app more than one time.

Some people (not many) want true parallel support in the same process. This is not hard to do, as you can add an instance of the browser/simulator as a parameter to ALL function calls, but obviously this makes the api kind of unpleasant.

You can support 2 apis, one that is nice and clean, and one that is less clean but allows for parallel.

This may not be a big problem for android/ios though because starting the simulator is so expensive.

Fight flakiness

Currently this testsuite still fails on our internal gitlab for timing issues. I assume we need to wait until the app is uploaded after every test. @lefthandedgoat us this possible?

Design discussion: Create own test runner or use existing like xUnit/fsUnit/etc

Creating a console based test runner is actually pretty easy and I have 2 working examples, one in canopy, and a parallel enabled one called prunner.

They offer a lot of pros but offer some cons.

##Pros
Simple and easy to make
Console is actually really powerful and well supported in various CI environments

##Cons (all of these do not bother me but frequently come up in issues on canopy)
No VS integration
People generally aren't as familiar with how to use console
You have to roll your own 'tags' for tests so that you can run subsets etc
Not xUnit/nUnit/the testing library they are used to

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.