Is there a Test Explorer for Playwright? - automated-tests

I am looking for a tests explorer for Playwright that has a GUI, similar to what Cypress has (as shown in the screenshot). That is, an interface that allows you to visualize and run your tests, but I find that in Playwright you can only run the tests from the command line or IDE. Any leads?

I don't think that Playwright has that option yet. But the closest thing that you can get is the Playwright Inspector.
To open the test in the Playwright Inspector UI, you have to run the command
Debugging all Tests: npx playwright test --debug
Debugging one test: npx playwright test example --debug
You will get a screen like this where you can visually see the test execution with test steps:
Another Option would be the Playwright Test extension for VS Code. You can visualize the test execution like this:
Another option would be the Playwright Cloud by LambdaTest. It is a paid tool but has a free tier. But it is exactly what you are looking for:

Related

How Can I Run A Test on Cypress, and Simultaneously Use The Cypress Inspector Tool To Build Other Tests?

I've got Cypress open running an e2e test that takes about 4 minutes. I've used the command in the CLI npx cypress open.
Whilst that is open and running, I would like to use the inspector tool
from Cypress to build another test.
Whilst building e2e tests, the gui does not allow for me to open another browser and start.
What would be a viable and repeatable option to run one test, whilst using the gui to build out another test with the inspector tool components?
you can just use npx cypress open a second time and have 2 instances of cypress working, one for the inspector tool and one for testing in the background.

Cypress run command without re-running test

Just wondering, say I have a lengthy cypress test that has finished running. Is there a way to try out a new cypress command, say something like
cy.get('.tg-tag').should('have.css', 'background-color', 'rgb(0, 128, 0)')
Thanks much!
There is the cy.now() internal command that allows the user to run a cypress command via dev tools in the test runner. Gleb has a general example here and a more detailed example here. The Cypress docs has a small example here.
There are also a few discussion on cypress github found below with examples of usage:
Support REPL #8195
test commands in the Chrome DevTools console #6080
You'll have to play around with your specific situation, but once your test has completed, open your dev tools and use the following format:
// cy.now(commandName, arguments…)
cy.now('visit', '/') // visit root
cy.now('contains', 'button', 'Sign in')
If you mean you want to use a kind of interactive mode for new/additional commands, there's the experimental Cypress Studio mode.
It's not free text, but you can add the expression you indicated, best described in the PR

Is there any way to get WebdriverIO E2E testing code coverage?

I am using WebdriverIO for the e2e automation testing. I would like to get the code coverage for my e2e tests. Is there any way I can get the code coverage for e2e tests?
Thanks in advance :)
Of course that's possible, see https://webdriver.io/docs/devtools-service.html#chrome-devtools-access.
Basically, instrument your code and grab the count after ech test or use browser build in feature
I created a npm module for this: https://www.npmjs.com/package/wdio-coverage-service
It is possible. Most automation tools now days have a plugin which can talk external code coverage services and get the stats after a test run is complete.
The steps are
Instrument your dev src code using a popular instrumentation tool called istanbul (https://istanbul.js.org/)
Serve the instrumented src code on your local machine
Run E2E Tests against the instrumented src code app
After run, the code coverage report is generated
more details: https://webdriver.io/docs/devtools-service/#capture-code-coverage
Also if you need complete details with video, Cypress has some live tutorial videos, this won't help you with wdio exactly, but you will get an overall idea of how coverage works with e2e: https://docs.cypress.io/guides/tooling/code-coverage#Introduction
No, it is not possible. It is black box testing - your tests can't reach code of your code and check what functions are called and check code coverage.
Check Black box testing - because E2E is kind of Black box testing.

How to view test results for in-progress tests in the release pipeline view?

According to...:
https://learn.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=vsts
​...You should be able to view test results for in-progress (automated)tests during the test execution but my test results are not published until the whole test run is complete. What am i doing wrong here?
In my release definition i have the Visual Studio test task. The automated GUI tests is executed from the Azure DevOps testHub which trigger the release job, but as said, the test results will not update until all tests are completed. How can this be done?
Also, why are my tests shown as "Others" and not "Not executed"?
​(Im using the "Test run" option in the Visual studio test task for "Select tests using".)
I guess you configured it wrong.
In docs it's said:
So what needs to be done is on your test task you should switch on parallel run:
But be careful with parallel running, it may require some work with your tests to make it possible.

Protractor implicit waiting not working when using grunt-protractor-runner

I am writing e2e Tests for some JS application at the moment. Since I am not a JS developer I was investigating on this theme for a while and ended up with the following setup:
Jasmine2 as testing framework
grunt as "build-tool"
protractor as test runner
jenkins as CI server (already in use for plenty java projects)
Although the application under tests is not written in angular I decided to go for protractor, following a nice guide on howto make protractor run nicely even without angular.
Writing some simple tests and running them locally worked like a charm. In order to implicitly wait for some elements to show up in den DOM I used the following code in my conf.js:
onPrepare: function() {
browser.driver.manage().timeouts().implicitlyWait(5000);
}
All my tests were running as expected and so I decided to go to the next step, i.e. installation in the CI server.
The development team of the aplication I want to tests was already using grunt to build their application so I decided to just hook myself into that. The goal of my new grunt task is to:
assemble the application
start a local webserver running the application
run my protractor test
write some test reports
Finally I accomplished all of the above steps, but I am dealing with a problem now I cannot solve and did not find any help googling it. In order to run the protractor test from grunt I installed the grunt-protractor-runner.
The tests are running, BUT the implicit wait is not working, causing some tests to fail. When I added some explicit waits (browser.sleep(...)) everything is ok again but that is not what I want.
Is there any chance to get implicitly waiting to work when using the grunt-protractor-runner?
UPDATE:
The problem does not have anything to do with the grunt-protractor-runner. When using a different webserver I start up during my taks its working again. To be more precisley: Using the plugin "grunt-contrib-connect" the tests is working using the plugin "grunt-php" the test fails. So I am looking for another php server for grunt now. I will be updating this question.
UPDATE 2:
While looking for some alternatives I considered and finally decided to mock the PHP part of the app.

Resources