Giter Club home page Giter Club logo

powerappstestautomation's Introduction

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

powerappstestautomation's People

Contributors

dependabot[bot] avatar devkeydet avatar jfinnecy avatar microsoftopensource avatar tylerol avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerappstestautomation's Issues

System.Exception: Login page failed using Cloud Identity Login.

Hello,

I'm trying to automate my canvas app tests
I followed instruction from here: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/test-studio-classic-pipeline-editor
Unfortunatelly I got error during execution of 'Run Power Apps Test Automation Tests via Firefox':
(same issue is visible for Chrome)

A total of 1 test files matched the specified pattern.
  Failed RunTestAutomation [7 m 32 s]
  Error Message:
   Test method Microsoft.PowerApps.TestAutomation.Tests.TestAutomation.RunTestAutomation threw exception: 
System.InvalidOperationException: Login failed after 3 attempts. Exception Details: System.Exception: Login page failed using Cloud Identity Login.
   at Microsoft.PowerApps.TestAutomation.Api.OnlineLogin.<>c.<Login>b__12_3(IWebDriver f) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\OnlineLogin.cs:line 160
   at Microsoft.PowerApps.TestAutomation.Browser.SeleniumExtensions.WaitUntilVisible(IWebDriver driver, By by, TimeSpan timeout, Action`1 successCallback, Action`1 failureCallback) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\Extensions\SeleniumExtensions.cs:line 737
   at Microsoft.PowerApps.TestAutomation.Api.OnlineLogin.Login(IWebDriver driver, Uri uri, SecureString username, SecureString password, Action`1 redirectAction) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\OnlineLogin.cs:line 141
   at Microsoft.PowerApps.TestAutomation.Browser.DelegateBrowserCommand`5.ExecuteCommand(IWebDriver driver, Object[] params) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\DelegateBrowserCommand.cs:line 134
   at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 136
   at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute[T1,T2,T3,T4](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 60
   at Microsoft.PowerApps.TestAutomation.Browser.BrowserPage.Execute[TResult,T1,T2,T3,T4](BrowserCommandOptions options, Func`6 delegate, T1 p1, T2 p2, T3 p3, T4 p4) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserPage.cs:line 230
   at Microsoft.PowerApps.TestAutomation.Api.OnlineLogin.Login(Uri uri, SecureString username, SecureString password) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\OnlineLogin.cs:line 73
   at Microsoft.PowerApps.TestAutomation.Tests.TestAutomation.RunTestAutomation() in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Tests\TestAutomation\RunTestAutomation.cs:line 113
  Stack Trace:
      at Microsoft.PowerApps.TestAutomation.Tests.TestAutomation.RunTestAutomation() in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Tests\TestAutomation\RunTestAutomation.cs:line 189
  Standard Output Messages:
 Login.MainPage failed to load in 2 minutes using Cloud Identity Login.
 Exception on Attempt #1: System.Exception: Login page failed using Cloud Identity Login.
    at Microsoft.PowerApps.TestAutomation.Api.OnlineLogin.<>c.<Login>b__12_3(IWebDriver f) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\OnlineLogin.cs:line 160
    at Microsoft.PowerApps.TestAutomation.Browser.SeleniumExtensions.WaitUntilVisible(IWebDriver driver, By by, TimeSpan timeout, Action`1 successCallback, Action`1 failureCallback) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\Extensions\SeleniumExtensions.cs:line 737
    at Microsoft.PowerApps.TestAutomation.Api.OnlineLogin.Login(IWebDriver driver, Uri uri, SecureString username, SecureString password, Action`1 redirectAction) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\OnlineLogin.cs:line 141
    at Microsoft.PowerApps.TestAutomation.Browser.DelegateBrowserCommand`5.ExecuteCommand(IWebDriver driver, Object[] params) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\DelegateBrowserCommand.cs:line 134
    at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 136
    at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute[T1,T2,T3,T4](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 60
    at Microsoft.PowerApps.TestAutomation.Browser.BrowserPage.Execute[TResult,T1,T2,T3,T4](BrowserCommandOptions options, Func`6 delegate, T1 p1, T2 p2, T3 p3, T4 p4) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserPage.cs:line 230
    at Microsoft.PowerApps.TestAutomation.Api.OnlineLogin.Login(Uri uri, SecureString username, SecureString password) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\OnlineLogin.cs:line 73
    at Microsoft.PowerApps.TestAutomation.Tests.TestAutomation.RunTestAutomation() in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Tests\TestAutomation\RunTestAutomation.cs:line 113

I verified my credentials few time and it workd.
Any hints where the problem is or what shall I check as a next step?

Trying run a PowerApps test automated

I'm getting some errors, someone can help?

First when is trying to Run the test I get this :
Test run detected DLL(s) which were built for different framework and platform versions. Following DLL(s) do not match current settings, which are .NETFramework,Version=v4.5 framework and X86 platform.
Microsoft.PowerApps.TestAutomation.Tests.dll is built for Framework .NETFramework,Version=v4.6 and Platform AnyCPU.

at the end :
##[error]Error: The process 'D:\a_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\3.225.0\Modules\DTAExecutionHost.exe' failed with exit code 1
##[error]Vstest failed with error. Check logs for failures. There might be failed tests.

User authentication and MFA

Hello guys,

at first I've searched an issue on test side or directly in the app. But with a simple "HelloWorld" PowerApp I have same errors (reproducible in the log:
##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
##[error]Error: The process 'D:\a_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\3.225.0\Modules\DTAExecutionHost.exe' failed with exit code 1
##[error]Vstest failed with error. Check logs for failures. There might be failed tests.

As output in the the tests, I've seen this image:
image

But I'm not able to get an application user with deactivated MFA. Is there a way to solve the authentication issue?

Many thanks and regards
MAK46

TestCaseResult

The testcaseresult is not reported to DevOps. It is not included in the jsonresultstring. The testsuiteresult is working fine.

Problems parsing override parameters

I've been experimenting with your promising project, but have run into trouble when running my pipeline.
The pipeline runs OK until it starts the tests for the browsers, when I receive a warning concerning failure to parse override parameters.

[warning]Unable to parse the override run parameters string: -OnlineUsername *** -OnlinePassword *** -BrowserType "Chrome" -OnlineUrl https://make.powerapps.com -UsePrivateMode true -TestAutomationURLFilePath D:\a\1\s\JamesPowerAppTesting\testURLs.json -DriversPath C:\SeleniumWebDrivers\ChromeDriver -LoginMethod CloudIdentity

The hard reference to Selenium doesn't appear to feature in the pipeline templates nor in the azure-pipeline.yml.

No service connector allowed

Hi,

I am trying to use this project to execute my automated tests for my PowerApps from an Azure DevOps pipeline.

My PowerApps use 2FA. For tasks other than VSTest@2 we are using service connectors however this doesn't seem to be able using VSTest@2. I am getting the following error:

An error occurred during Test Run #1 of 1: System.InvalidOperationException: Login failed after 3 attempts. Exception Details: System.Exception: Login page failed on login retry.

Any ideas on how to overcome this issue?

Any help would be appreciated.

Thanks and regards

Add Test Studio Test Cases to an existing pipeline (pipeline has Azure Repos GIT source)

I am attempting to add test cases created in PowerApp Test Studio to a Azure DevOps Pipeline. Instructions here show how to add test cases to a new pipeline:
https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/test-studio-yaml-pipeline

The project I am working on already has a pipeline set up, that references a Azure Repos GIT source.

What would be the best way to set up test cases into an existing repo such as above? Perhaps the code in this repo would be added in the existing Azure Repo?

Inconsistent Results in Pipeline

Actions:

  • Test Studio test are working
  • Created test user for accessing the tests with access to app and dataverse (CRUD)
  • MFA and Security defaults disabled
  • Repository cloned in Azure DevOps
  • Updated TestURLs.json
  • Service connection setup
  • Pipeline setup with variables
  • Disabled Firefox task (only running Test on Chrome)

Issue:

  • Running the Test from the pipeline produces inconsistent results (Same tests in test studio, same commit in repo)
  • Sometimes it is successful, but mostly fails. (only 21.43% pass rate)

image

  • Majority of failed runs report the following prompt:
Error Message:
   Test method Microsoft.PowerApps.TestAutomation.Tests.TestAutomation.RunTestAutomation threw exception: 
OpenQA.Selenium.JavaScriptException: javascript error: Cannot read properties of undefined (reading 'Log')
  (Session info: chrome=99.0.4844.74)
  Stack Trace:
      at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args)
   at OpenQA.Selenium.WebDriver.ExecuteScript(String script, Object[] args)
   at Microsoft.PowerApps.TestAutomation.Browser.SeleniumExtensions.ExecuteScript(IWebDriver driver, String script, Object[] args) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\Extensions\SeleniumExtensions.cs:line 165
   at Microsoft.PowerApps.TestAutomation.Api.TestAutomation.InitiateTest(IWebDriver driver, Uri uri) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\TestAutomation.cs:line 142
   at Microsoft.PowerApps.TestAutomation.Api.TestAutomation.<>c__DisplayClass1_0.<ExecuteTestAutomation>b__0(IWebDriver driver) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\TestAutomation.cs:line 35
   at Microsoft.PowerApps.TestAutomation.Browser.DelegateBrowserCommand`1.ExecuteCommand(IWebDriver driver, Object[] params) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\DelegateBrowserCommand.cs:line 28
   at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 136
   at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute(IWebDriver driver) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 36
   at Microsoft.PowerApps.TestAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserPage.cs:line 182
   at Microsoft.PowerApps.TestAutomation.Api.TestAutomation.ExecuteTestAutomation(Uri uri, Int32 testRunNumber, Int32 maxWaitTimeInSeconds) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\TestAutomation.cs:line 32
   at Microsoft.PowerApps.TestAutomation.Tests.TestAutomation.RunTestAutomation() in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Tests\TestAutomation\RunTestAutomation.cs:line 193
  Standard Output Messages:
 Power Apps  Test Automation Execution Starting Test #1 of 1
 An error occurred during Test Run #1 of 1: OpenQA.Selenium.JavaScriptException: javascript error: Cannot read properties of undefined (reading 'Log')
  (Session info: chrome=99.0.4844.74)
    at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse)
    at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
    at OpenQA.Selenium.WebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args)
    at OpenQA.Selenium.WebDriver.ExecuteScript(String script, Object[] args)
    at Microsoft.PowerApps.TestAutomation.Browser.SeleniumExtensions.ExecuteScript(IWebDriver driver, String script, Object[] args) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\Extensions\SeleniumExtensions.cs:line 165
    at Microsoft.PowerApps.TestAutomation.Api.TestAutomation.InitiateTest(IWebDriver driver, Uri uri) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\TestAutomation.cs:line 142
    at Microsoft.PowerApps.TestAutomation.Api.TestAutomation.<>c__DisplayClass1_0.<ExecuteTestAutomation>b__0(IWebDriver driver) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\TestAutomation.cs:line 35
    at Microsoft.PowerApps.TestAutomation.Browser.DelegateBrowserCommand`1.ExecuteCommand(IWebDriver driver, Object[] params) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\DelegateBrowserCommand.cs:line 28
    at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 136
    at Microsoft.PowerApps.TestAutomation.Browser.BrowserCommand`1.Execute(IWebDriver driver) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserCommand.cs:line 36
    at Microsoft.PowerApps.TestAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Browser\BrowserPage.cs:line 182
    at Microsoft.PowerApps.TestAutomation.Api.TestAutomation.ExecuteTestAutomation(Uri uri, Int32 testRunNumber, Int32 maxWaitTimeInSeconds) in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Api\Pages\TestAutomation.cs:line 32
    at Microsoft.PowerApps.TestAutomation.Tests.TestAutomation.RunTestAutomation() in D:\a\1\s\Microsoft.PowerApps.TestAutomation.Tests\TestAutomation\RunTestAutomation.cs:line 162
 Current results directory location: D:\a\_temp\..\TestResults\TestResults\Deploy_VssAdministrator 2022-03-24 12_50_24\In

Parameter 'UsePrivateMode' is not working

If I set the 'UsePrivateMode' parameter to false, the browser will still be in private mode.
The RunTestSettings.Initialize method is not called, so the options are not overwritten.

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.