Trouble getting custom artifacts in java testng appium run

0

I read through the previous posts around this subject and changed my code so that I pass $WORKING_DIRECTORY to my code and the tests execute and tell me that they created reports, etc in 2020-07-01 20:59:26 Messager [main-1] [INFO] [SM-T860] RESULT #1: TEST [SetupOnly - testSetupFlow] PASS [screenshots=file:// /tmp/scratchTm8wqJ.scratch/test-packageJ9ckZb/tmp/customer_artifacts_working_directorytD0aTZ/1593636962238/3fda58af-0cf0-4bed-90a4-707eb8f2efdb/report.html | log=file:// /tmp/scratchTm8wqJ.scratch/test-packageJ9ckZb/tmp/customer_artifacts_working_directorytD0aTZ/1593636962238/3fda58af-0cf0-4bed-90a4-707eb8f2efdb/test.log].
URL should look like a file url for tmp/scratchTm8wqJ.scratch/test-packageJ9ckZb/tmp/customer_artifacts_working_directorytD0aTZ/1593636962238/3fda58af-0cf0-4bed-90a4-707eb8f2efdb/report.html

I do not get the reports in the customer artifacts. I tried adding $WORKING_DIRECTORY in the artifacts section of the test spec and my test spec output shows:
chmod: cannot access ‘/tmp/customer_artifacts_working_directorytD0aTZ/*’: Permission denied

Help???

Edited by: hclmobiletests on Jul 1, 2020 2:09 PM
edited the urls in the output pointing to the report.html and test.log so they don't get modified (add space between file: // and the directory).

Edited by: hclmobiletests on Jul 1, 2020 2:11 PM
another attempt to show the file path for the url

已提問 4 年前檢視次數 303 次
4 個答案
0

Hi hclmobiletest,

I assume you have been following the approach mentioned in the following link. Please double check that.
https://aws.amazon.com/blogs/mobile/custom-artifacts-on-aws-device-farm/

If your approach is the same, can you share run url for one of the runs so that we can investigate this.

AWS
已回答 4 年前
0

Yes, that is the approach I was trying to follow. For example in projects/7448c707-aa1e-4cea-8e9e-47b516e8902b/runs/6ac81cff-786a-48d9-a926-4eaeac0f1320 , in the test spec, I do a echo "project_report_directory=$WORKING_DIRECTORY" >> target/classes/_config.properties which ended up setting it to. project_report_directory=/tmp/customer_artifacts_working_directoryTGBaBw. At the end of the run, my framework told me that the output had been created (test spec log line 240), but the path is /tmp/scratchOfaEGq.scratch/test-packageAiHwxW/tmp/customer_artifacts_working_directoryTGBaBw/.

已回答 4 年前
0

It seems the framework is getting the base directory from System.getProperty("user.dir") and then appending the path which I was giving $WORKING_DIRECTORY. That is the issue. I will try to pass user.dir to testNG in the java command line and see if that will resolve this.

已回答 4 年前
0

The problem is solved. I just need to pass -Duser.dir=$DEVICEFARM_LOG_DIR on the java command line so that the framework puts its screenshots and report content under the Log dir and it is finally getting collected with the testng result.

已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南