Skip to content

Instantly share code, notes, and snippets.

@jcdalton2201
jcdalton2201 / SimpleButtonTest.js
Created October 7, 2019 15:17
Jasmine test for button
describe('Visual regression Test for Simple Button', () => {
let browser = null;
let page = null;
afterEach(async () => {
await page.evaluate(element => {
element.innerHTML = '';
}, bodyhandle);
await page.close();
await browser.close();
});
it('Test accessibility of the button', async () => {
const Differencify = require('differencify');
const differencify = new Differencify({});
browser = difUtil.setTestName(
differencify,
'Test accessibility of the button'
);
page = await difUtil.createPage(browser);
const bodyhandle = await difUtil.createBodyHandle(page);
await page.evaluate(element => {
@jcdalton2201
jcdalton2201 / external-files.js
Created November 7, 2019 19:23
dynamic import
export class ExternalFiles{
constructor() {
this.getChat();
this.getCalendar();
}
async getChat(){
if(!customElements.get('foo-chat')){
await import('chat/chat.js');
}
}