
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
codeceptjs-lwc-example
Advanced tools
This repository automates the LWC Recipes page using Selenium WebDriver thru Codeceptjs-BDD framework. It uses Cucumber BDD Feature files to automate the LWC Features. You can also choose to automate with Mocha styles traditional tests. For more info, take a look at Codeceptjs-BDD Docs.
This example automates the HelloBinding LWC Component on LWC Recipe - https://recipes.lwc.dev/#hello
git clone git@github.com:gkushang/codeceptjs-bdd.git
cd codeceptjs-bdd/packages/codeceptjs-lwc-example
yarn
yarn acceptance
yarn acceptance:report
This example automates the Hello Binding
component from the LWC Recipes Page.
@hello_binding @lwc_recipes
Feature: HelloBinding from Salesforce LWC Recipes
As a LWC developer
I want to be able to automate the LWC Shadow Dom Components
So that I can quickly create my UI Automated Suite using Selenium
=> LWC Recipe Page: https://recipes.lwc.dev/#hello
@hello_binding_component
Scenario: Fred successfully types in and verifies the title in Hello Binding LWC Component
When Fred types "Kushang Gajjar" into the Hello Binding Component
Then he sees the title is updated accordingly
The work is still in-progress for the changes to be accepted at CodeceptJS. Here is the proposal on how to select the element when it's chained with custom elements.
In the page object, you can define your locators as a special shadow
locator.
// input field on helloBinding component
inputField: { shadow: [...parent,'ui-input', 'input.input' ]}
Since it inherits the elements from the host/parent, you can define your Page Objects as a Class and take benefits of inheritance in your page objects. This makes a lot of your code/locators Re-usable across the app.
class HelloBinding extends LightingComponent {
constructor() {
super();
// common elements for shadow locators
const parent = [...this.host, 'recipe-hello-binding'];
// locators uses "shadow", and elements are sequentially defined
this.locators = {
// input field on helloBinding component
inputField: { shadow: [...parent, 'ui-input', 'input.input' ]},
// card title on helloBinding component
cardTitle: { shadow: [...parent, 'div p']}
}
}
enterName(name) {
return I.fillField(this.locators.inputField, name);
}
async grabTitle() {
return await I.grabTextFrom(this.locators.cardTitle);
}
}
FAQs
Salesforce's LWC Recipes Acceptance Tests
The npm package codeceptjs-lwc-example receives a total of 3 weekly downloads. As such, codeceptjs-lwc-example popularity was classified as not popular.
We found that codeceptjs-lwc-example demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.