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

Ignore - Add some debug logs #117

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/browser/fixture.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-console: 0 */

import { nextFrame, fixture as wcFixture } from '@open-wc/testing';
import { reset } from './reset.js';

Expand Down Expand Up @@ -48,11 +50,19 @@ async function waitForElem(elem, awaitLoadingComplete = true) {
}

export async function fixture(element, opts = {}) {
console.log('before reset');
await Promise.all([reset(opts), document.fonts.ready]);
console.log('after reset');
console.log('before wcFixture');
const elem = await wcFixture(element);
console.log('after wcFixture');
console.log('before waitForElem');
await waitForElem(elem, opts.awaitLoadingComplete);
console.log('after waitForElem');

console.log('before pause');
await pause();
console.log('after pause');
return elem;
}

Expand Down
3 changes: 2 additions & 1 deletion src/browser/reset.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-console: 0 */

import { sendMouse, setViewport } from '@web/test-runner-commands';
import { nextFrame } from '@open-wc/testing';

Expand All @@ -18,7 +20,6 @@ export function requestMouseReset() {
}

export async function reset(opts) {

opts = opts || {};
opts.lang = opts.lang || DEFAULT_LANG;
opts.mathjax = opts.mathjax || {};
Expand Down
4 changes: 4 additions & 0 deletions test/browser/commands.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint no-console: 0 */

import { clickAt, clickElem, expect, fixture, focusElem, hoverAt, hoverElem, sendKeys, sendKeysElem } from '../../src/browser/index.js';
import { html } from 'lit';
import { spy } from 'sinon';
Expand All @@ -7,7 +9,9 @@ describe('commands', () => {
let elem;
const input = html`<input type="text">`;
beforeEach(async() => {
console.log('before fixture');
elem = await fixture(input);
console.log('after fixture');
});

it('should click on element', async() => {
Expand Down