Skip to content

Instantly share code, notes, and snippets.

package com.example.tests.junit4;
import org.testingisdocumenting.webtau.junit4.WebTauRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.testingisdocumenting.webtau.WebTauGroovyDsl.*;
@RunWith(WebTauRunner.class)
public class WeatherJavaTest {
package com.example.tests.junit4
import org.testingisdocumenting.webtau.junit4.WebTauRunner
import org.junit.Test
import org.junit.runner.RunWith
import static org.testingisdocumenting.webtau.WebTauGroovyDsl.*
@RunWith(WebTauRunner.class) // required for html report generation only
class WeatherGroovyTest {
scenario("simple get") {
http.get("/weather") {
temperature.shouldBe < 100
}
}
const registries = new Registries();
registries.add('components')
.registerAsTwoColumnTable('Buttons', buttonsDemo)
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
if (process.env.NODE_ENV === 'production') {
ReactDOM.render(<App />, document.getElementById('root'));
} else {
const {ComponentViewer} = require('react-component-viewer');
ReactDOM.render(<ComponentViewer .../>, document.getElementById('root'));
import { Registries, WrapperProps } from 'react-component-viewer';
const registries = new Registries({componentWrapper: DemoWrapper});
registries.add('components', {componentWrapper: WidgetsWrapper})
.registerAsGrid('Links', 300, linksDemo)
.registerAsTwoColumnTable('Buttons', buttonsDemo)
.registerAsRows('Inputs', inputsDemo);
function WidgetsWrapper({OriginalComponent}: WrapperProps) {
return (
import { Registries, WrapperProps } from 'react-component-viewer';
const registries = new Registries({componentWrapper: DemoWrapper});
registries.add('components')
.registerAsGrid('Links', 300, linksDemo)
.registerAsTwoColumnTable('Buttons', buttonsDemo)
.registerAsRows('Inputs', inputsDemo);
function DemoWrapper({OriginalComponent}: WrapperProps) {
return (
export class MyAppComponentViewer extends React.Component {
render() {
return (
<ComponentViewer
registries={registries}
dropDown={{
label: 'Brand',
items: [
{label: 'Brand One', hotKey: 'Alt 1'},
{label: 'Brand Two', hotKey: 'Alt 2'}
import * as React from 'react';
import { Registry, simpleAction } from 'react-component-viewer';
import { Button } from './Button';
const onClick = simpleAction('clicked');
export function buttonsDemo(registry: Registry) {
registry
.add('primary button', () => (