-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding e2e test coverage #2400
Adding e2e test coverage #2400
Conversation
I am currently testing the new pipeline in here: https://github.com/christian-bromann/vscode-live-server/actions |
Tests are passing on Ubuntu, MacOS and Windows. To summarise this patch, it:
Happy to clarify certain changes or answer other questions. This is now ready for review. |
@ritwickdey any comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for the PR ❤️
|
||
it('should click on Go Live', async () => { | ||
const workbench = await driver.getWorkbench(); | ||
await workbench.elem.$('div[id="ritwickdey.LiveServer"]').click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the ID defined by vscode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is the extension id: <publisher>.<name>
browser = await remote({ | ||
capabilities: { browserName: 'chrome' } | ||
}); | ||
const workbench = await driver.getWorkbench(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Looks good to me but this comment about the API)
I'm a bit confused here. Does driver.getWorkbench()
gives vscode instance variable? driver
is from webdriverio
package. right?
Yes, it is a page object that comes with the
Correct. Just pushed an update and tests passed. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently this extension has a set of simple unit tests. Unfortunately there is no assurance that the functionality works across operating systems. Also the tests are run within Travis which has been ceased.
What is the new behavior?
This patch adds a simple e2e test to ensure that the server starts and a browser is able to connect and receive files. It also moves the test execution to GitHub Action.
Does this PR introduce a breaking change?
Other information
I am the maintainer of WebdriverIO and recently started building VSCode extensions, e.g. Marquee. I've experienced that there wasn't good tooling for e2e test scenarios that are sometimes needed for complex extensions like yours.