This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"temperature": 88 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scenario("simple get") { | |
http.get("/weather") { | |
temperature.shouldBe < 100 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', () => ( |