Codeception failure screenshots - automation

Codeception plugin Recorder saves all the steps till failure if tests fails. e.g.
01.png - Success
02.png - Success
03.png - Failure
Is there any way how can I only save 03.png failure screenshot without having success screens saved along ?
Thank you in advanced
Codeception: v2.2.2
PhantomJS as webdriver: v2.1

delete_successful (default: true) - delete records for successfully passed tests (log only failed and errored)
from: http://codeception.com/addons#configuration

Related

Cypress test results do not appear in reportportal

I'm using "cypress": "^8.7.0" and "#reportportal/agent-js-cypress": "^5.0.2" with node 14
My reportportal implementation is already running well with testcafe for another project. Now I tried setting it up with this project that uses cypress and the results just don't show up in RP. I followed every step shown here:
https://github.com/reportportal/agent-js-cypress
I turned on the debug option in the reporter options and I'm getting this output:
Finish test item ...
Success finish item ...
Finish test item ...
Success finish item ...
Finish launch ...
Success finish launch ...
This sounds like the launch worked but I do not see anything in RP. Does anyone have an idea what I'm missing?
Try adding /api/v1 at the end of your endpoint.
For example:
endpoint=https://reportportal.com/api/v1
I was facing the same issue with similar debug logs. Adding /api/v1 in the endpoint solved the problem for me.
Note - agent-js-cypress is not yet supported with Cypress 10.0 or above. Details https://github.com/reportportal/agent-js-cypress/issues/116

How to integrate selenium with lighthouse

We are currently trying to integrate selenium with lighthouse.
When we try with the below command we were able to trigger the lighthouse for 1 url.
lighthouse https://application.com/app --port=1156--collect.settings.maxWaitForFcp="45000" --emulated-form-factor=none--output=html --output-path=./GoogleHome.html
But We want it to be integrated with the selenium so that we can run one full flow from login into the logout.
options.setExperimentalOption("debuggerAddress", "127.0.0.1:1156");
ChromeDriver driver = new ChromeDriver(options);
WebDriverWait wait = new WebDriverWait(driver,20);
// Label: Launch
driver.get(" https://application.com/app");```
with the above code in the selenium script we are getting the below error
Note the URL provided in the script is valid and we can navigate it manually.
Note: the port number dynamically generated in the selenium is used in the command.
Error:
```config:warn IFrameElements gatherer requested, however no audit requires it. +0ms
config:warn FormElements gatherer requested, however no audit requires it. +3ms
Runtime error encountered: The URL you have provided appears to be invalid.
LHError: INVALID_URL at Function.run (C:\Users\AppData\Roaming\npm\node_modu
les\lighthouse\lighthouse-core\runner.js:79:17)
at lighthouse (C:\Users\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\index.js:52:17)
at runLighthouse (C:\Users\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-cli\run.js:226:32)
at processTicksAndRejections (internal/process/task_queues.js:93:5)```
Any recommendation on what's missing?

Unable to recognize RETRY UNTIL definition

I am trying to implement the retry until functionality in a feature.
Scenario: Send a valid request and verify response status = 200
Given path requestPath
And configure retry = { count: 10, interval: 5000 }
And retry until responseStatus == 200
When method get
However the step remains undefined in my ide. I have tried the following:
Updating to latest intelliJ Community 2018.3
invalidated cache and restarted intelliJ
uninstalled and reinstalled Cucumber for Java
verify Gherkin plugin installed.
verified test folder is marked as Test Sources root
tried using Karate 0.9.0.RC3
What else can I try to make the squiggly line go away?!?]1
Use the latest Karate 0.9.0 (final).

Test Failing after upgrade from 0.2.7 to 0.6.1

After upgrading from 0.2.7 to 0.6.1, I am seeing a test failure when running from gradle.
The failing test is a simple:
And match response.dispositionInstructions == "Disposition Instructions"
When I run from intellij, the test passes.
Running from gradle, the following is logged:
15:11:22.840 [DEBUG] [TestEventLogger] com.intuit.karate.exception.KarateException: path: $.dispositionInstructions, actual: '{"dispositionInstructions":"Disposition Instructions", rest of document omitted}’ , expected: 'Disposition Instructions', reason: not equal
Not sure if it is relevant, but the JSON document is over 94k long.
However, if I paste the document (from the log) into a JSON validator (jsonlint.com), it shows it as being valid.
I am keen to exploit the new functionality and this is the only issue blocking me.
Any suggestions as to why this is failing on 0.6.1?
Dev of Karate here. Thanks for the clear explanation of the issue !
My guess is that this is related to this particular issue: https://github.com/intuit/karate/issues/144
Unfortunately, the person who logged that issue never reverted. I really hope that the suggested tweak to the surefire plugin to set the file.encoding does the trick.
Else do log an issue and cross-refer the above issue so that a notification goes out to the OP for that one. With your help I can hopefully finally replicate this issue, and I may need your help to create a fake large payload that can simulate this problem in my local environment.

calabash-android run app-debug.apk throws exception

I am trying to run calabash-android to test my app, but I get the following error, the same app without any modification was working before I tried to do some modifications, but then I reverted all the modifications to the app :
Exception occurred while dumping:
java.lang.IllegalArgumentException: Unknown package: com.bitbar.testdroid
at com.android.server.pm.Settings.isOrphaned(Settings.java:4134)
at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:18091)
at com.android.server.pm.PackageManagerService.deletePackage(PackageManagerService.java:15508)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:888)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
at android.os.ShellCommand.exec(ShellCommand.java:94)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18349)
at android.os.Binder.shellCommand(Binder.java:468)
at android.os.Binder.onTransact(Binder.java:367)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3031)
at android.os.Binder.execTransact(Binder.java:565)
And then
Success
Success
Scenario: I can choose a file from the Gallery # features/my_first.feature:3
HTTPClient::KeepAliveDisconnected: Connection reset by peer # io_fillbuf - fd:8 (HTTPClient::KeepAliveDisconnected)
./features/support/app_life_cycle_hooks.rb:5:in `Before'
When I take a screenshot # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9
Then I take a screenshot # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9
Failing Scenarios:
cucumber features/my_first.feature:3 # Scenario: I can choose a file from the Gallery
1 scenario (1 failed)
2 steps (2 skipped)
0m6.240s
Exception ScreenShot
I solved the problem by running the build using the gradle task :app:assembleDebug
in the exception above, calabash can't find the package name, because it is on another dex class.
I think in calabash, they may be having problem with multidex projects, and Android Studio will always enable multidex to your app, even if it doesn't need it.
I am not an expert, any suggestion are welcome, and I hope some people can benefit from this answer.