Skip to content
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

Documentation issues #9

Open
msteller-connyun opened this issue Feb 26, 2019 · 0 comments
Open

Documentation issues #9

msteller-connyun opened this issue Feb 26, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@msteller-connyun
Copy link

Showroom seems to be very usefull for web components, but the documentation needs to be improved.

Your puppeteer integration example didn’t work for me, but I found this blog

https://medium.com/@eavichay/easy-unit-tests-for-your-web-components-e26bf88483a9

which is using require('showroom/puppeteer')(). But showroom/puppeteer isn’t mentioned in your docu.

trigger() is also not documented, which allows us to call the showroom functions from our config.

Some documentation for find() would would be also useful.

My current test looks with puppeteer and jest looks like this:

const showroom = require('showroom/puppeteer')();

describe('My awesome Test Suite', async () => {

  beforeAll(async () => {
    await showroom.start();
  });

  beforeEach(async () => {
    await showroom.utils.setTestSubject('calendar-graph');
  });

  afterAll(async ()=>{
    await showroom.stop();
  });

  test('Awesome component test', async () => {
    await showroom.utils.trigger('initStatusMapping');
    await showroom.utils.trigger('initData');
    const foo = await (await showroom.utils.find('//*')).getProperty('innerHTML');

    expect(foo._remoteObject.value).toBe('test');

  });
});

For some reason getProperty() returns an Object instead of the string directly.

@eavichay eavichay self-assigned this Feb 27, 2019
@eavichay eavichay added the bug Something isn't working label Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants