提交 6aa4ffd8 编写于 作者: C chengxingzhen

xts-失败用例适配

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 c6b4d17f
...@@ -14,11 +14,38 @@ ...@@ -14,11 +14,38 @@
*/ */
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
import {describe, beforeEach, afterEach, it, expect} from '@ohos/hypium'; import {describe, beforeEach, afterEach, beforeAll, afterAll, it, expect} from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function ContextJsunit() { export default function ContextJsunit() {
describe('faContextTest', function () { describe('faContextTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == faContextTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
beforeEach(async function (done) { beforeEach(async function (done) {
console.info("context before each called"); console.info("context before each called");
done() done()
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from '@ohos/hypium'; import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
import ability_particleAbility from '@ohos.ability.particleAbility';
import abilityManager from "@ohos.application.appManager" import abilityManager from "@ohos.application.appManager"
import backgroundTaskManager from '@ohos.backgroundTaskManager';
const TAG_TEST_0100 = ' context_isUpdatingConfigurations_test_0100 '; const TAG_TEST_0100 = ' context_isUpdatingConfigurations_test_0100 ';
const TAG_TEST_0200 = ' context_isUpdatingConfigurations_test_0200 '; const TAG_TEST_0200 = ' context_isUpdatingConfigurations_test_0200 ';
...@@ -33,6 +33,33 @@ const TAG_TEST_0012 = ' context_featureAbility_test_0400 '; ...@@ -33,6 +33,33 @@ const TAG_TEST_0012 = ' context_featureAbility_test_0400 ';
export default function addContextAndAbilityJsunit() { export default function addContextAndAbilityJsunit() {
describe('addContextTest', function () { describe('addContextTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == addContextTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/* /*
* @tc.number: context_isUpdatingConfigurations_test_0100 * @tc.number: context_isUpdatingConfigurations_test_0100
* @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing. * @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing.
......
...@@ -12,13 +12,40 @@ ...@@ -12,13 +12,40 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from '@ohos/hypium'; import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() { export default function getHapModuleInfoJsunit() {
describe('getAbilityInfoTest', function () { describe('getAbilityInfoTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getAbilityInfoTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/** /**
* @tc.number: context_getAbilityInfo_test_0100 * @tc.number: context_getAbilityInfo_test_0100
* @tc.name: getAbilityInfo:Query the current attributionability details. * @tc.name: getAbilityInfo:Query the current attributionability details.
......
...@@ -12,12 +12,40 @@ ...@@ -12,12 +12,40 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from '@ohos/hypium'; import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() { export default function getHapModuleInfoJsunit() {
describe('getAppVersionInfoTest', function () { describe('getAppVersionInfoTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getAppVersionInfoTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/** /**
* @tc.number: context_getAppVersionInfo_test_0100 * @tc.number: context_getAppVersionInfo_test_0100
* @tc.name: getAppVersionInfo:Gets the version information for the application. * @tc.name: getAppVersionInfo:Gets the version information for the application.
......
...@@ -12,12 +12,40 @@ ...@@ -12,12 +12,40 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from '@ohos/hypium'; import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() { export default function getHapModuleInfoJsunit() {
describe('getApplicationContextTest', function () { describe('getApplicationContextTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getApplicationContextTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/** /**
* @tc.number: context_getApplicationContext_test_0100 * @tc.number: context_getApplicationContext_test_0100
* @tc.name: getApplicationContext:Gets the application context information. * @tc.name: getApplicationContext:Gets the application context information.
......
...@@ -12,14 +12,40 @@ ...@@ -12,14 +12,40 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {describe, it, expect} from '@ohos/hypium'; import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium';
import Utils from './Utils'; import Utils from './Utils';
import ability_featureAbility from '@ohos.ability.featureAbility'; import ability_featureAbility from '@ohos.ability.featureAbility';
import backgroundTaskManager from '@ohos.backgroundTaskManager';
export default function getHapModuleInfoJsunit() { export default function getHapModuleInfoJsunit() {
describe('getHapModuleInfoTest', function () { describe('getHapModuleInfoTest', function () {
let TAG1 = "SUB_AA_OpenHarmony == getHapModuleInfoTest: ";
let sleepTimeOne = 1000;
let id = undefined;
beforeAll(async (done) => {
console.log(TAG1 + "beforeAll called");
let myReason = 'test FaShowOnLockTest';
let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => {
console.log(TAG1 + "Request suspension delay will time out.");
})
id = delayInfo.requestId;
console.log(TAG1 + "requestId is : " + id);
setTimeout(function () {
console.log(TAG1 + "beforeAll end");
done();
}, sleepTimeOne);
})
afterAll(async (done) => {
console.log(TAG1 + "afterAll called");
backgroundTaskManager.cancelSuspendDelay(id);
setTimeout(function () {
console.log(TAG1 + "afterAll end");
done();
}, sleepTimeOne);
})
/** /**
* @tc.number: context_getHapModuleInfo_test_0100 * @tc.number: context_getHapModuleInfo_test_0100
* @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application. * @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application.
......
...@@ -642,6 +642,7 @@ export default function ApiCoverTest() { ...@@ -642,6 +642,7 @@ export default function ApiCoverTest() {
console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext)) console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext))
console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext.config)) console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext.config))
let directions = globalThis.stageContext.config.direction let directions = globalThis.stageContext.config.direction
let pointer = globalThis.stageContext.config.hasPointerDevice
let subscriber = null let subscriber = null
let subscribeInfo = { let subscribeInfo = {
events: ["AbilityStage_StartAbility"] events: ["AbilityStage_StartAbility"]
...@@ -654,6 +655,7 @@ export default function ApiCoverTest() { ...@@ -654,6 +655,7 @@ export default function ApiCoverTest() {
console.info("SUB_AA_FMS_AbilityStage_0100===SubscribeInfoCallback===" + JSON.stringify(data)) console.info("SUB_AA_FMS_AbilityStage_0100===SubscribeInfoCallback===" + JSON.stringify(data))
expect(data.parameters["config"]).assertEqual(-1) expect(data.parameters["config"]).assertEqual(-1)
expect(data.parameters["config"]).assertEqual(directions) expect(data.parameters["config"]).assertEqual(directions)
expect(pointer).assertFalse()
commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback) commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback)
await sleep(4000) await sleep(4000)
done() done()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册