microsoft / PowerApps-TestEngine

MIT License
93 stars 28 forks source link

pac test run error 'Something went wrong when Test Engine tried to get App status.' #319

Open temmyraharjo opened 4 months ago

temmyraharjo commented 4 months ago

Hi Team,

I've got the below error when I run the test:

System.TimeoutException: Something went wrong when Test Engine tried to get App status.
   at Microsoft.PowerApps.TestEngine.Helpers.PollingHelper.CheckIfTimedOut(DateTime startTime, Int32 timeout, ILogger logger, String errorMessage)
   at Microsoft.PowerApps.TestEngine.Helpers.PollingHelper.<PollAsync>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerApps.TestEngine.PowerFx.PowerFxEngine.<UpdatePowerFxModelAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.PowerApps.TestEngine.SingleTestRunner.<RunTestAsync>d__26.MoveNext()

Here is the yaml file:

testSuite:
  testSuiteName: CreateNewAgent
  testSuiteDescription: ''
  persona: User1
  appLogicalName: tmy_agentsapp_0f43e
  appId: '4c5d263c-c0ec-e661-917e-e774a4790401'
  onTestCaseStart: |
    =
    Wait(NewRecordLabel1, "Text", "New")
  onTestCaseComplete: ""
  onTestSuiteComplete: ""
  networkRequestMocks: 
  testCases:
  - testCaseName: CasePerformanceCheck
    testCaseDescription: ''
    testSteps: |
      =
      Select(NewRecordAddIcon1);
      Select(DataCardValue1);
      Set(TxtGuid, Substitute(GUID(), "-", ""));
      Set(TxtCode, Left(TxtGuid, 6));
      Set(TxtCommision, Text(RandBetween(1, 100)/100));
      SetProperty(DataCardValue1.Text, TxtCode);
      SetProperty(DataCardValue2.Text, TxtGuid);
      SetProperty(DataCardValue3.Text, TxtCommision);
      SetProperty(DataCardValue4.Text, "Indonesia");
      SetProperty(DataCardValue6.Text, "Jakarta");
      Set(DateStart, Now());
      Select(SubmitFormButton1);
      Set(DateEnd, Now());
      Set(TotalSeconds, DateDiff(DateStart, DateEnd,TimeUnit.Seconds));
      Notify("Total seconds:"&TotalSeconds);
      Set(Result, CountRows(Filter('[dbo].[AGENTS]',AGENT_CODE=TxtCode)));
      Assert(Result > 0, "Saved successfully");
      Assert(TotalSeconds< 2);
testSettings:
  filePath: 
  browserConfigurations:
  - browser: Chromium
    device: 
    screenWidth: 1080
    screenHeight: 810
  locale: en-US
  recordVideo: true
  headless: false
  enablePowerFxOverlay: false
  timeout: 30000
environmentVariables:
  filePath: 
  users:
  - personaName: User1
    emailKey: user1Email
    passwordKey: user1Password

I just generated an App from SQL Data > the test itself is clicking the "New" button. But, I believed the test itself just successfully logged in and when the App loaded, it got this error (not yet run through the test step). I attached the app, recording, and debugLog. AgentApp_20240217025245.zip e1b7af5fa6f872cada4ae16090ef87ad.webm debugLogs.txt

improving-jeffd commented 4 months ago

I am seeing the same issue with my app that I am trying to test. I even set headless to false and see it load the app successfully. I see signs that my networkRequestMocks are not working but the simplest test that I am trying to run (check if a button is disabled to test permissions) should still pass.