Hello! My name is {this.normalize(this.name)}.
--- id: stencil title: Stencil --- [Stencil](https://stenciljs.com/) is a library for building reusable, scalable component libraries. You can test Stencil components directly in a real browser using WebdriverIO and its [browser runner](/docs/runner#browser-runner). ## Setup To set up WebdriverIO within your Stencil project, follow the [instructions](/docs/component-testing#set-up) in our component testing docs. Make sure to select `stencil` as preset within your runner options, e.g.: ```js // wdio.conf.js export const config = { // ... runner: ['browser', { preset: 'stencil' }], // ... } ``` :::info In case you use Stencil with a framework like React or Vue, you should keep the preset for these frameworks. ::: You can then start the tests by running: ```sh npx wdio run ./wdio.conf.ts ``` ## Writing Tests Given you have the following Stencil components: ```tsx title="./components/Component.tsx" import { Component, Prop, h } from '@stencil/core' @Component({ tag: 'my-name', shadow: true }) export class MyName { @Prop() name: string normalize(name: string): string { if (name) { return name.slice(0, 1).toUpperCase() + name.slice(1).toLowerCase() } return '' } render() { return (
Hello! My name is {this.normalize(this.name)}.