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

test(android): run selected page tests on android (2) #5882

Merged
merged 1 commit into from
Mar 19, 2021
Merged
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
4 changes: 2 additions & 2 deletions test/frame-evaluate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ it('should dispose context on cross-origin navigation', (test, { mode }) => {
it('should execute after cross-site navigation', async ({ page, server }) => {
await page.goto(server.EMPTY_PAGE);
const mainFrame = page.mainFrame();
expect(await mainFrame.evaluate(() => window.location.href)).toContain('localhost');
expect(await mainFrame.evaluate(() => window.location.href)).toContain(server.EMPTY_PAGE);
await page.goto(server.CROSS_PROCESS_PREFIX + '/empty.html');
expect(await mainFrame.evaluate(() => window.location.href)).toContain('127');
expect(await mainFrame.evaluate(() => window.location.href)).toContain(server.CROSS_PROCESS_PREFIX);
});

it('should not allow cross-frame js handles', async ({ page, server }) => {
Expand Down
1 change: 1 addition & 0 deletions test/page/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Put tests that are scoped to a page and can run on Chrome for Android, WebView, Electron, etc.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({ page, server }) => {
await page.goto(server.PREFIX + '/input/button.html');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { attachFrame } from './utils';
import { it, expect } from '../fixtures';
import { attachFrame } from '../utils';

it('should work', async ({ page, server }) => {
await page.goto(server.EMPTY_PAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should have a nice preview', async ({ page, server }) => {
await page.goto(`${server.PREFIX}/dom.html`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({page, server}) => {
await page.setContent('<html><body><div class="tweet"><div class="like">100</div><div class="retweets">10</div></div></body></html>');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should hover', async ({ page, server }) => {
await page.goto(server.PREFIX + '/input/scrollable.html');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { attachFrame } from './utils';
import { it, expect } from '../fixtures';
import { attachFrame } from '../utils';

it('should work', async ({ page, server }) => {
await page.goto(server.EMPTY_PAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({ page }) => {
await page.setContent(`<input type='text' />`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should query existing element', async ({page, server}) => {
await page.goto(server.PREFIX + '/playground.html');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({ page, server }) => {
it('should work', test => {
test.fixme(process.env.PW_ANDROID_TESTS);
}, async ({ page, server }) => {
await page.goto(server.PREFIX + '/offscreenbuttons.html');
for (let i = 0; i < 11; ++i) {
const button = await page.$('#btn' + i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should select textarea', async ({ page, server, isFirefox }) => {
await page.goto(server.PREFIX + '/input/textarea.html');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({ page }) => {
await page.setContent(`<input type='text' />`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

async function giveItAChanceToResolve(page) {
for (let i = 0; i < 5; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work with css selector', async ({page, server}) => {
await page.setContent('<div>hello</div><div>beautiful</div><div>world!</div>');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work with css selector', async ({page, server}) => {
await page.setContent('<section id="testAttribute">43543</section>');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({page}) => {
const aHandle = await page.evaluateHandle(() => document.body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work with function', async ({page}) => {
const windowHandle = await page.evaluateHandle(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({page}) => {
const aHandle = await page.evaluateHandle(() => ({foo: 'bar'}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import type { ElementHandle } from '..';
import { it, expect } from '../fixtures';
import type { ElementHandle } from '../..';

it('should work', async ({page}) => {
const aHandle = await page.evaluateHandle(() => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work for primitives', async ({page}) => {
const numberHandle = await page.evaluateHandle(() => 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';
import util from 'util';

it('should work', async ({page}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect, describe } from './fixtures';
import { it, expect, describe } from '../fixtures';
import * as os from 'os';

function crash(page, toImpl, browserName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('Page.Events.Request', async ({page, server}) => {
const requests = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should fire', async ({page, server, isWebKit}) => {
const [error] = await Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { it, expect } from '../fixtures';

it('should work', async ({page}) => {
const [popup] = await Promise.all([
Expand All @@ -35,9 +35,7 @@ it('should work with window features', async ({page, server}) => {
expect(await popup.evaluate(() => !!window.opener)).toBe(true);
});

it('should emit for immediately closed popups', async ({browser}) => {
const context = await browser.newContext();
const page = await context.newPage();
it('should emit for immediately closed popups', async ({page}) => {
const [popup] = await Promise.all([
page.waitForEvent('popup'),
page.evaluate(() => {
Expand All @@ -46,7 +44,6 @@ it('should emit for immediately closed popups', async ({browser}) => {
}),
]);
expect(popup).toBeTruthy();
await context.close();
});

it('should emit for immediately closed popups 2', (test, {browserName, video}) => {
Expand All @@ -63,9 +60,7 @@ it('should emit for immediately closed popups 2', (test, {browserName, video}) =
expect(popup).toBeTruthy();
});

it('should be able to capture alert', async ({browser}) => {
const context = await browser.newContext();
const page = await context.newPage();
it('should be able to capture alert', async ({page}) => {
const evaluatePromise = page.evaluate(() => {
const win = window.open('');
win.alert('hello');
Expand All @@ -75,7 +70,6 @@ it('should be able to capture alert', async ({browser}) => {
expect(dialog.message()).toBe('hello');
await dialog.dismiss();
await evaluatePromise;
await context.close();
});

it('should work with empty url', async ({page}) => {
Expand Down Expand Up @@ -150,8 +144,7 @@ it('should work with clicking target=_blank and rel=noopener', async ({page, ser
expect(await popup.evaluate(() => !!window.opener)).toBe(false);
});

it('should not treat navigations as new popups', async ({context, server}) => {
const page = await context.newPage();
it('should not treat navigations as new popups', async ({page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.setContent('<a target=_blank rel=noopener href="/one-style.html">yo</a>');
const [popup] = await Promise.all([
Expand All @@ -161,6 +154,6 @@ it('should not treat navigations as new popups', async ({context, server}) => {
let badSecondPopup = false;
page.on('popup', () => badSecondPopup = true);
await popup.goto(server.CROSS_PROCESS_PREFIX + '/empty.html');
await context.close();
await page.close();
expect(badSecondPopup).toBe(false);
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*/

import { it, expect } from './fixtures';
import { attachFrame } from './utils';
import { it, expect } from '../fixtures';
import { attachFrame } from '../utils';

it('should fire for navigation requests', async ({page, server}) => {
const requests = [];
Expand All @@ -41,7 +41,9 @@ it('should fire for fetches', async ({page, server}) => {
expect(requests.length).toBe(2);
});

it('should report requests and responses handled by service worker', async ({page, server}) => {
it('should report requests and responses handled by service worker', test => {
test.fixme(process.env.PW_ANDROID_TESTS);
}, async ({page, server}) => {
await page.goto(server.PREFIX + '/serviceworkers/fetchdummy/sw.html');
await page.evaluate(() => window['activationPromise']);
const [swResponse, request] = await Promise.all([
Expand Down