提交 2bb3d33e 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: android 端测试例规避 app-webview 模式

上级 022544f6
...@@ -23,7 +23,7 @@ describe('ExtApi-DownloadFile', () => { ...@@ -23,7 +23,7 @@ describe('ExtApi-DownloadFile', () => {
}); });
let shouldTestCookie = false let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1]) version = parseInt(version.split(" ")[1])
shouldTestCookie = version > 9 shouldTestCookie = version > 9
......
...@@ -22,7 +22,7 @@ describe("onLoad", () => { ...@@ -22,7 +22,7 @@ describe("onLoad", () => {
expect(page.path).toBe(TARGET_PAGE_PATH.substring(1)); expect(page.path).toBe(TARGET_PAGE_PATH.substring(1));
}); });
it("navigateBack", async () => { it("navigateBack", async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor('view'); await page.waitFor('view');
await page.callMethod("navigateToOnLoadWithType", "navigateBack"); await page.callMethod("navigateToOnLoadWithType", "navigateBack");
......
...@@ -86,7 +86,7 @@ describe('ExtApi-Request', () => { ...@@ -86,7 +86,7 @@ describe('ExtApi-Request', () => {
}); });
let shouldTestCookie = false let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1]) version = parseInt(version.split(" ")[1])
shouldTestCookie = version > 9 shouldTestCookie = version > 9
......
...@@ -37,7 +37,7 @@ describe('ExtApi-UploadFile', () => { ...@@ -37,7 +37,7 @@ describe('ExtApi-UploadFile', () => {
}); });
let shouldTestCookie = false let shouldTestCookie = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1]) version = parseInt(version.split(" ")[1])
shouldTestCookie = version > 9 shouldTestCookie = version > 9
......
...@@ -8,7 +8,7 @@ describe('component-native-overflow', () => { ...@@ -8,7 +8,7 @@ describe('component-native-overflow', () => {
//检测overflow设置hidden,visible //检测overflow设置hidden,visible
it('check_view_overflow', async () => { it('check_view_overflow', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1]) version = parseInt(version.split(" ")[1])
//安卓7模拟器不截图 导致闪退 //安卓7模拟器不截图 导致闪退
......
...@@ -10,7 +10,7 @@ describe('event trigger sequence', () => { ...@@ -10,7 +10,7 @@ describe('event trigger sequence', () => {
}) })
it('touch', async () => { it('touch', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
await el.touchstart({ await el.touchstart({
touches: [{ touches: [{
identifier: 1, identifier: 1,
...@@ -56,7 +56,7 @@ describe('event trigger sequence', () => { ...@@ -56,7 +56,7 @@ describe('event trigger sequence', () => {
}) })
it('longPress', async () => { it('longPress', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
await el.longpress() await el.longpress()
const data = await page.data() const data = await page.data()
expect(data.onLongPressTime).toBeGreaterThan(0) expect(data.onLongPressTime).toBeGreaterThan(0)
......
...@@ -30,7 +30,7 @@ describe('component-native-image', () => { ...@@ -30,7 +30,7 @@ describe('component-native-image', () => {
expect(await page.data('loadError')).toBe(true) expect(await page.data('loadError')).toBe(true)
}) })
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
it('check-cookie', async () => { it('check-cookie', async () => {
await page.setData({ await page.setData({
autoTest: true, autoTest: true,
......
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ // uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('component-native-scroll-view-refresher', () => { describe('component-native-scroll-view-refresher', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let page; let page;
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/component/scroll-view/scroll-view-refresher'); page = await program.reLaunch('/pages/component/scroll-view/scroll-view-refresher');
......
...@@ -19,7 +19,7 @@ describe('component-native-sticky-section', () => { ...@@ -19,7 +19,7 @@ describe('component-native-sticky-section', () => {
await page.setData({ await page.setData({
scrolling: 'true' scrolling: 'true'
}) })
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
//跳转到id为C的StickyHeader位置 //跳转到id为C的StickyHeader位置
await page.callMethod('gotoStickyHeader', 'C') await page.callMethod('gotoStickyHeader', 'C')
} }
......
...@@ -12,7 +12,7 @@ describe('component-native-web-view', () => { ...@@ -12,7 +12,7 @@ describe('component-native-web-view', () => {
}); });
it('screenshot', async () => { it('screenshot', async () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
await page.waitFor(async () => { await page.waitFor(async () => {
return await page.data('loadFinish') === true; return await page.data('loadFinish') === true;
}); });
......
// uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/ // uni-app自动化测试教程: uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('component-native-web-view', () => { describe('component-native-web-view', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let page; let page;
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch('/pages/component/web-view/web-view'); page = await program.reLaunch('/pages/component/web-view/web-view');
......
...@@ -121,7 +121,7 @@ const pages = [ ...@@ -121,7 +121,7 @@ const pages = [
// '/pages/API/element-draw/element-draw', // '/pages/API/element-draw/element-draw',
] ]
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android')&& !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
// 规避 web 端不支持页面 // 规避 web 端不支持页面
pages.push( pages.push(
"/pages/component/list-view/list-view", "/pages/component/list-view/list-view",
......
...@@ -237,7 +237,7 @@ const PAGE_PATH = ...@@ -237,7 +237,7 @@ const PAGE_PATH =
describe("shot-compare", () => { describe("shot-compare", () => {
let shouldCompareScreenShot = false let shouldCompareScreenShot = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1]) version = parseInt(version.split(" ")[1])
shouldCompareScreenShot = version > 9 shouldCompareScreenShot = version > 9
......
...@@ -236,7 +236,7 @@ const PAGE_PATH = ...@@ -236,7 +236,7 @@ const PAGE_PATH =
describe("shot-compare", () => { describe("shot-compare", () => {
let shouldCompareScreenShot = false let shouldCompareScreenShot = false
if (process.env.uniTestPlatformInfo.startsWith('android')) { if (process.env.uniTestPlatformInfo.startsWith('android') && !process.env.UNI_AUTOMATOR_APP_WEBVIEW) {
let version = process.env.uniTestPlatformInfo let version = process.env.uniTestPlatformInfo
version = parseInt(version.split(" ")[1]) version = parseInt(version.split(" ")[1])
shouldCompareScreenShot = version > 9 shouldCompareScreenShot = version > 9
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册