提交 14993a69 编写于 作者: W wangjinxin613

test: ios 截图不截图状态栏部分

上级 a5b06f8a
......@@ -3,7 +3,7 @@
describe('API-loading', () => {
let page;
const isAndroid = process.env.UNI_OS_NAME === "android";
const isApp = process.env.UNI_OS_NAME === "android" || process.env.UNI_OS_NAME === "ios";
beforeAll(async () => {
page = await program.reLaunch('/pages/API/action-sheet/action-sheet')
......@@ -12,7 +12,7 @@ describe('API-loading', () => {
it("onload-action-sheet-test", async () => {
if (isAndroid) {
if (isApp) {
await page.waitFor(500);
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
......@@ -57,7 +57,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -99,7 +99,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -140,7 +140,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -181,7 +181,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -222,7 +222,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -266,7 +266,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -307,7 +307,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -348,7 +348,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -389,7 +389,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -431,7 +431,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -472,7 +472,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......@@ -513,7 +513,7 @@ describe('API-loading', () => {
await btnToastDurationButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const image = await program.screenshot({
deviceShot: true,
area: {
......
......@@ -3,7 +3,7 @@
describe('API-loading', () => {
let page;
const isAndroid = process.env.UNI_OS_NAME === "android";
const isApp = process.env.UNI_OS_NAME === "android" || process.env.UNI_OS_NAME === "ios";
beforeAll(async () => {
page = await program.reLaunch('/pages/API/modal/modal')
......@@ -13,7 +13,7 @@ describe('API-loading', () => {
it("onload-modal-test", async () => {
if (isAndroid) {
if (isApp) {
await page.waitFor(500);
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
......@@ -54,7 +54,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -95,7 +95,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -136,7 +136,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -177,7 +177,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -218,7 +218,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -258,7 +258,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -298,7 +298,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -338,7 +338,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -378,7 +378,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -419,7 +419,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -460,7 +460,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -501,7 +501,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -542,7 +542,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -583,7 +583,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -625,7 +625,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -665,7 +665,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -706,7 +706,7 @@ describe('API-loading', () => {
await btnModalButton.tap()
await page.waitFor(500);
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......
......@@ -3,7 +3,7 @@
describe('API-toast', () => {
let page;
const isAndroid = process.env.UNI_OS_NAME === "android";
const isApp = process.env.UNI_OS_NAME === "android" || process.env.UNI_OS_NAME === "ios";
beforeAll(async () => {
......@@ -16,7 +16,7 @@ describe('API-toast', () => {
it("onload-toast-test", async () => {
if (isAndroid) {
if (isApp) {
await page.waitFor(500);
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
......@@ -47,7 +47,7 @@ describe('API-toast', () => {
const btnToastDefaultButton = await page.$('#btn-toast-default')
await btnToastDefaultButton.tap()
await page.waitFor(200)
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
......@@ -78,7 +78,7 @@ describe('API-toast', () => {
const btnToastDurationButton = await page.$('#btn-toast-duration')
await btnToastDurationButton.tap()
await page.waitFor(2000)
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -105,7 +105,7 @@ describe('API-toast', () => {
const btnToastErrorIconButton = await page.$('#btn-toast-errorIcon')
await btnToastErrorIconButton.tap()
await page.waitFor(200)
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -138,7 +138,7 @@ describe('API-toast', () => {
await btnToastHideButton.tap()
await page.waitFor(1000)
if (isAndroid) {
if (isApp) {
const res = await page.callMethod('jest_getWindowInfo')
const windowHeight = res.windowHeight * res.pixelRatio;
const windowWidth = res.windowWidth * res.pixelRatio;
......@@ -166,7 +166,7 @@ describe('API-toast', () => {
// const btnToastButton = await page.$('#btn-toast-postion-bottom')
// await btnToastButton.tap()
// await page.waitFor(200)
// if (isAndroid) {
// if (isApp) {
// const windowHeight = uni.getWindowInfo().windowHeight;
// const windowWidth = uni.getWindowInfo().windowWidth;
// const image = await program.screenshot({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册