1/* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16// @ts-nocheck 17import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' 18import deviceinfo from '@ohos.deviceInfo' 19 20export default function DeviceInfoTest() { 21 describe('DeviceInfoTest', function () { 22 23 const MAX_CHARACTERS_NUM_ONE = 33; 24 const MAX_CHARACTERS_NUM_TWO = 65; 25 const MAX_CHARACTERS_NUM = 0; 26 27 beforeAll(function () { 28 console.info('beforeAll: Prerequisites at the test suite level, which are executed before the test suite is executed.'); 29 30 }) 31 32 beforeEach(function () { 33 console.info('beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.'); 34 35 }) 36 afterEach(function () { 37 console.info('afterEach: Test case-level clearance conditions, which are executed after each test case is executed.'); 38 39 }) 40 afterAll(function () { 41 console.info('afterAll: Test suite-level cleanup condition, which is executed after the test suite is executed'); 42 43 }) 44 45 console.info('start################################start'); 46 47 /** 48 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0100 49 * @tc.name testGetDeviceType01 50 * @tc.desc Get a string representing the device type. 51 * @tc.size : MEDIUM 52 * @tc.type : Function 53 * @tc.level : Level 0 54 */ 55 it('device_info_test_001', 0, function () { 56 console.info('device_info_test_001 start'); 57 let ret = false; 58 let deviceTypeInfo = deviceinfo.deviceType; 59 console.info('the value of the deviceType is :' + deviceTypeInfo); 60 61 expect(deviceTypeInfo).assertInstanceOf('String'); 62 if (deviceTypeInfo != "" && deviceTypeInfo != null && deviceTypeInfo != undefined) { 63 ret = true; 64 } 65 expect(ret).assertTrue() 66 console.info('device_info_test_001 : end'); 67 }) 68 69 /** 70 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0200 71 * @tc.name testGetManufacture01 72 * @tc.desc Get the manufacture name represented by a string. 73 * @tc.size : MEDIUM 74 * @tc.type : Function 75 * @tc.level : Level 0 76 */ 77 it('device_info_test_002', 0, function () { 78 console.info('device_info_test_002 start'); 79 80 let manufactureInfo = deviceinfo.manufacture; 81 console.info('the value of the manufactureInfo is :' + manufactureInfo); 82 expect(manufactureInfo).assertInstanceOf('String'); 83 if (manufactureInfo != "" && manufactureInfo != null && manufactureInfo != undefined) { 84 let str = /[\w-\.\(\)]/g; 85 let arr = manufactureInfo.match(str); 86 let bufferstr = arr.join(''); 87 console.info('the value of the bufferstr is :' + bufferstr); 88 expect(manufactureInfo).assertEqual(bufferstr); 89 } else { 90 console.info('the return value is null or incorrect.'); 91 expect(false).assertFalse(); 92 } 93 94 console.info('device_info_test_002 :end'); 95 }) 96 97 /** 98 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0300 99 * @tc.name testGetBrand01 100 * @tc.desc Get the device brand represented by a string and the return value is not null. 101 * @tc.size : MEDIUM 102 * @tc.type : Function 103 * @tc.level : Level 0 104 */ 105 it('device_info_test_003', 0, function () { 106 console.info('testGetDeviceBrand01 start'); 107 108 let brandInfo = deviceinfo.brand; 109 console.info('the value of the device brand is :' + brandInfo); 110 111 expect(brandInfo).assertInstanceOf('String'); 112 if (brandInfo != "" && brandInfo != null && brandInfo != undefined) { 113 let str = /[\w-\.\(\)]/g; 114 let arr = brandInfo.match(str); 115 let bufferstr = arr.join(''); 116 console.info('the value of the bufferstr is :' + bufferstr); 117 expect(brandInfo).assertEqual(bufferstr); 118 } else { 119 console.info('the return value is null or incorrect.'); 120 expect(false).assertFalse(); 121 } 122 123 console.info('testGetDeviceBrand01 :end'); 124 }) 125 126 /** 127 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0400 128 * @tc.name testGetMarketName01 129 * @tc.desc Get the external product family name represented by a string and the return value is not null. 130 * @tc.size : MEDIUM 131 * @tc.type : Function 132 * @tc.level : Level 0 133 */ 134 it('device_info_test_004', 0, function () { 135 console.info('testGetMarketName01 start') 136 let ret = false; 137 let marketNameInfo = deviceinfo.marketName; 138 console.info('the value of the deviceinfo marketName is :' + marketNameInfo); 139 140 expect(marketNameInfo).assertInstanceOf('String'); 141 if (marketNameInfo != "" && marketNameInfo != null && marketNameInfo != undefined) { 142 ret = true; 143 } 144 expect(ret).assertTrue(); 145 console.info('testGetMarketName01 :end'); 146 }) 147 148 /** 149 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0500 150 * @tc.name testGetProductSeries01 151 * @tc.desc Get the product series represented by a string and the return value is not null. 152 * @tc.size : MEDIUM 153 * @tc.type : Function 154 * @tc.level : Level 0 155 */ 156 it('device_info_test_005', 0, function () { 157 console.info('testGetProductSeries01 start'); 158 159 let productSeriesInfo = deviceinfo.productSeries; 160 console.info('the value of the deviceinfo productSeries is :' + productSeriesInfo); 161 162 expect(productSeriesInfo).assertInstanceOf('String'); 163 if (productSeriesInfo != "" && productSeriesInfo != null && productSeriesInfo != undefined) { 164 let str = /[\w-\.\(\)\s]/g; 165 let arr = productSeriesInfo.match(str); 166 let bufferstr = arr.join(''); 167 console.info('the value of the bufferstr is :' + bufferstr); 168 expect(productSeriesInfo).assertEqual(bufferstr); 169 } else { 170 console.info('the return value is null or incorrect.'); 171 expect(false).assertFalse(); 172 } 173 174 console.info('testGetProductSeries01 :end'); 175 }) 176 177 /** 178 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0600 179 * @tc.name testGetProductModel01 180 * @tc.desc Get the internal software sub-model represented by a string and the return value is not null. 181 * @tc.size : MEDIUM 182 * @tc.type : Function 183 * @tc.level : Level 0 184 */ 185 it('device_info_test_006', 0, function () { 186 console.info('testGetProductModel01 start'); 187 let ret = false; 188 let productModelInfo = deviceinfo.productModel; 189 console.info('the value of the deviceinfo productModel is :' + productModelInfo); 190 191 expect(productModelInfo).assertInstanceOf('String'); 192 if (productModelInfo != "" && productModelInfo != null && productModelInfo != undefined) { 193 ret = true; 194 } 195 expect(ret).assertTrue(); 196 console.info('testGetProductModel01 : end'); 197 }) 198 199 /** 200 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0700 201 * @tc.name testGetSoftwareModel01 202 * @tc.desc Get the internal software sub-model represented by a string and the return value is not null. 203 * @tc.size : MEDIUM 204 * @tc.type : Function 205 * @tc.level : Level 0 206 */ 207 it('device_info_test_007', 0, function () { 208 console.info('testGetSoftwareModel01 start'); 209 210 let softwareModelInfo = deviceinfo.softwareModel; 211 console.info('the value of the deviceinfo softwareModel is :' + softwareModelInfo); 212 213 expect(softwareModelInfo).assertInstanceOf('String'); 214 if (softwareModelInfo != "" && softwareModelInfo != null && softwareModelInfo != undefined) { 215 let str = /[\w-\.\(\)\s]/g; 216 let arr = softwareModelInfo.match(str); 217 let bufferstr = arr.join(''); 218 console.info('the value of the bufferstr is :' + bufferstr); 219 expect(softwareModelInfo).assertEqual(bufferstr); 220 } else { 221 console.info('the return value is null or incorrect.'); 222 expect(false).assertFalse(); 223 } 224 225 console.info('testGetSoftwareModel01 :end'); 226 }) 227 228 /** 229 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0800 230 * @tc.name testGetHardWareModel01 231 * @tc.desc Get the hardware version represented by a string and the return value is not null. 232 * @tc.size : MEDIUM 233 * @tc.type : Function 234 * @tc.level : Level 0 235 */ 236 it('device_info_test_008', 0, function () { 237 console.info('testGetHardWareModel01 start'); 238 239 let hardwareModelInfo = deviceinfo.hardwareModel; 240 console.info('the value of the deviceinfo hardwareModel is :' + hardwareModelInfo); 241 242 expect(hardwareModelInfo).assertInstanceOf('String'); 243 if (hardwareModelInfo != "" && hardwareModelInfo != null && hardwareModelInfo != undefined) { 244 let str = /[\w-\.\(\)]/g; 245 let arr = hardwareModelInfo.match(str); 246 let bufferstr = arr.join(''); 247 console.info('the value of the bufferstr is :' + bufferstr); 248 expect(hardwareModelInfo).assertEqual(bufferstr); 249 } else { 250 console.info('the return value is null or incorrect.'); 251 expect(false).assertFalse(); 252 } 253 254 console.info('testGetHardWareModel01 :end'); 255 }) 256 257 /** 258 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0900 259 * @tc.name testGetHardWareProfile01 260 * @tc.desc Get the hardware profile represented by a string and the return value is not null. 261 * @tc.size : MEDIUM 262 * @tc.type : Function 263 * @tc.level : Level 0 264 */ 265 it('device_info_test_009', 0, function () { 266 console.info('testGetHardWareProfile01 start'); 267 268 let hardwareProfileInfo = deviceinfo.hardwareProfile; 269 console.info('the value of the deviceinfo hardwareProfile is :' + hardwareProfileInfo); 270 271 expect(hardwareProfileInfo).assertInstanceOf('String'); 272 if (hardwareProfileInfo != "" && hardwareProfileInfo != null && hardwareProfileInfo != undefined) { 273 let str = /[\w-\.\(\)]/g; 274 let arr = hardwareProfileInfo.match(str); 275 let bufferstr = arr.join(''); 276 console.info('the value of the bufferstr is :' + bufferstr); 277 expect(hardwareProfileInfo).assertEqual(bufferstr); 278 } else { 279 console.info('the return value is null or incorrect.'); 280 expect(false).assertFalse(); 281 } 282 283 console.info('testGetHardWareProfile01 :end'); 284 }) 285 286 /** 287 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0110 288 * @tc.name testGetSerial01 289 * @tc.desc Get the device serial number represented by a string and the return value is not null. 290 * @tc.size : MEDIUM 291 * @tc.type : Function 292 * @tc.level : Level 0 293 */ 294 it('device_info_test_010', 0, function () { 295 console.info('testGetSerial01 start'); 296 297 let serialInfo = deviceinfo.serial; 298 console.info('the value of the deviceinfo serial is :' + serialInfo); 299 300 expect(serialInfo).assertInstanceOf('String'); 301 if (serialInfo != "" && serialInfo != null && serialInfo != undefined) { 302 let str = /[\w-\.\(\)]/g; 303 let arr = serialInfo.match(str); 304 let bufferstr = arr.join(''); 305 console.info('the value of the bufferstr is :' + bufferstr); 306 expect(serialInfo).assertEqual(bufferstr); 307 } else { 308 console.info('the return value is null or incorrect.'); 309 expect(false).assertFalse(); 310 } 311 312 console.info('testGetSerial01 :end'); 313 }) 314 315 /** 316 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0120 317 * @tc.name testGetBootLoaderVersion01 318 * @tc.desc Get the bootloader version number represented by a string and the return value is not null. 319 * @tc.size : MEDIUM 320 * @tc.type : Function 321 * @tc.level : Level 0 322 */ 323 it('device_info_test_011', 0, function () { 324 console.info('testGetBootLoaderVersion01 start'); 325 326 let bootloaderVersionInfo = deviceinfo.bootloaderVersion; 327 console.info('the value of the deviceinfo bootloaderVersion is :' + bootloaderVersionInfo); 328 329 expect(bootloaderVersionInfo).assertInstanceOf('String'); 330 if (bootloaderVersionInfo != "" && bootloaderVersionInfo != null && bootloaderVersionInfo != undefined) { 331 let str = /[\w-\.\(\)]/g; 332 let arr = bootloaderVersionInfo.match(str); 333 let bufferstr = arr.join(''); 334 console.info('the value of the bufferstr is :' + bufferstr); 335 expect(bootloaderVersionInfo).assertEqual(bufferstr); 336 } else { 337 console.info('the return value is null or incorrect.'); 338 expect(false).assertFalse(); 339 } 340 341 console.info('testGetBootLoaderVersion01 :end') 342 }) 343 344 /** 345 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0130 346 * @tc.name testGetabiList01 347 * @tc.desc Get the instruction set supported by the system and the return value is not null. 348 * @tc.size : MEDIUM 349 * @tc.type : Function 350 * @tc.level : Level 0 351 */ 352 it('device_info_test_012', 0, function () { 353 console.info('testGetabiList01 start'); 354 355 let abiListInfo = deviceinfo.abiList; 356 console.info('the value of the deviceinfo abiList is :' + abiListInfo); 357 358 expect(abiListInfo).assertInstanceOf('String'); 359 if (abiListInfo != "" && abiListInfo != null && abiListInfo != undefined) { 360 let str = /[\w-\.\(\)\,]/g; 361 let arr = abiListInfo.match(str); 362 let bufferstr = arr.join(''); 363 console.info('the value of the bufferstr is :' + bufferstr); 364 expect(abiListInfo).assertEqual(bufferstr); 365 } else { 366 console.info('the return value is null or incorrect.'); 367 expect(false).assertFalse(); 368 } 369 370 console.info('testGetabiList01 :end'); 371 }) 372 373 /** 374 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0140 375 * @tc.name testGetSecurityPatchTag01 376 * @tc.desc Get the security patch level represented by a string and the return value is not null. 377 * @tc.size : MEDIUM 378 * @tc.type : Function 379 * @tc.level : Level 0 380 */ 381 it('device_info_test_013', 0, function () { 382 console.info('testGetSecurityPatchTag01 start'); 383 384 let securityPatchTagInfo = deviceinfo.securityPatchTag; 385 console.info('the value of the deviceinfo securityPatchTag is :' + securityPatchTagInfo); 386 387 expect(securityPatchTagInfo).assertInstanceOf('String'); 388 if (securityPatchTagInfo != "" && securityPatchTagInfo != null && securityPatchTagInfo != undefined) { 389 let str = /[\w\/\.\(\)]/g; 390 let arr = securityPatchTagInfo.match(str); 391 let bufferstr = arr.join(''); 392 console.info('the value of the bufferstr is :' + bufferstr); 393 expect(securityPatchTagInfo).assertEqual(bufferstr); 394 } else { 395 console.info('the return value is null or incorrect.'); 396 expect(false).assertFalse(); 397 } 398 399 console.info('testGetSecurityPatchTag01 :end'); 400 }) 401 402 /** 403 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0150 404 * @tc.name testGetDisplayVersion01 405 * @tc.desc Get the product version represented by a string and the return value is not null. 406 * @tc.size : MEDIUM 407 * @tc.type : Function 408 * @tc.level : Level 0 409 */ 410 it('device_info_test_014', 0, function () { 411 console.info('testGetDisplayVersion01 start'); 412 let ret = false; 413 let displayVersionInfo = deviceinfo.displayVersion; 414 console.info('the value of the deviceinfo displayVersion is :' + displayVersionInfo); 415 416 expect(displayVersionInfo).assertInstanceOf('String'); 417 if (displayVersionInfo != "" && displayVersionInfo != null && displayVersionInfo != undefined) { 418 ret = true; 419 } 420 expect(ret).assertTrue(); 421 console.info('testGetDisplayVersion01 :end'); 422 }) 423 424 /** 425 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0160 426 * @tc.name testGetIncrementalVersion01 427 * @tc.desc Get the incremental version represented by a string and the return value is not null. 428 * @tc.size : MEDIUM 429 * @tc.type : Function 430 * @tc.level : Level 0 431 */ 432 it('device_info_test_015', 0, function () { 433 console.info('testGetIncrementalVersion01 start'); 434 435 let incrementalVersionInfo = deviceinfo.incrementalVersion; 436 console.info('the value of the deviceinfo incrementalVersion is :' + incrementalVersionInfo); 437 438 expect(incrementalVersionInfo).assertInstanceOf('String'); 439 if (incrementalVersionInfo != "" && incrementalVersionInfo != null && incrementalVersionInfo != undefined) { 440 let str = /[\w-\.\(\)]/g; 441 let arr = incrementalVersionInfo.match(str); 442 let bufferstr = arr.join(''); 443 console.info('the value of the bufferstr is :' + bufferstr); 444 expect(incrementalVersionInfo).assertEqual(bufferstr); 445 } else { 446 console.info('the return value is null or incorrect.'); 447 expect(false).assertFalse(); 448 } 449 450 console.info('testGetIncrementalVersion01 :end'); 451 }) 452 453 /** 454 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0170 455 * @tc.name testGetOSReleaserType01 456 * @tc.desc Get the OS release type represented by a string and the return value is not null. 457 * @tc.size : MEDIUM 458 * @tc.type : Function 459 * @tc.level : Level 0 460 */ 461 it('device_info_test_016', 0, function () { 462 console.info('testGetOSReleaserType01 start'); 463 464 let osReleaseTypeInfo = deviceinfo.osReleaseType; 465 console.info('the value of the deviceinfo osReleaseType is :' + osReleaseTypeInfo); 466 467 expect(osReleaseTypeInfo).assertInstanceOf('String'); 468 if (osReleaseTypeInfo != "" && osReleaseTypeInfo != null && osReleaseTypeInfo != undefined) { 469 let str = /[\w-\.\(\)]/g; 470 let arr = osReleaseTypeInfo.match(str); 471 let bufferstr = arr.join(''); 472 console.info('the value of the bufferstr is :' + bufferstr); 473 expect(osReleaseTypeInfo).assertEqual(bufferstr); 474 } else { 475 console.info('the return value is null or incorrect.'); 476 expect(false).assertFalse(); 477 } 478 479 console.info('testGetOSReleaserType01 :end'); 480 }) 481 482 /** 483 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0180 484 * @tc.name testGetOSFullName01 485 * @tc.desc Get the operating system full name and the return value is not null. 486 * @tc.size : MEDIUM 487 * @tc.type : Function 488 * @tc.level : Level 0 489 */ 490 it('device_info_test_017', 0, function () { 491 console.info('testGetOSFullName01 start'); 492 493 let osFullNameInfo = deviceinfo.osFullName; 494 console.info('the value of the deviceinfo osFullName is :' + osFullNameInfo); 495 496 expect(osFullNameInfo).assertInstanceOf('String'); 497 if (osFullNameInfo != "" && osFullNameInfo != null && osFullNameInfo != undefined) { 498 let str = /[\w-\.\(\)]/g; 499 let arr = osFullNameInfo.match(str); 500 let bufferstr = arr.join(''); 501 console.info('the value of the bufferstr is :' + bufferstr); 502 expect(osFullNameInfo).assertEqual(bufferstr); 503 } else { 504 console.info('the return value is null or incorrect.'); 505 expect(false).assertFalse(); 506 } 507 508 console.info('testGetOSFullName01 :end'); 509 }) 510 511 /** 512 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0190 513 * @tc.name testGetMajorVersion01 514 * @tc.desc Get the major (M) version number which the return value is greater than 0. 515 * @tc.size : MEDIUM 516 * @tc.type : Function 517 * @tc.level : Level 0 518 */ 519 it('device_info_test_018', 0, function () { 520 console.info('testGetMajorVersion01 start'); 521 522 let majorVersionInfo = deviceinfo.majorVersion; 523 console.info('the value of the deviceinfo majorVersion is :' + majorVersionInfo); 524 525 expect(majorVersionInfo).assertInstanceOf('Number'); 526 if (majorVersionInfo >= 1 && majorVersionInfo <= 99) { 527 let str = /[\w-\.\(\)]/g; 528 let arr = majorVersionInfo.toString().match(str); 529 let substr = arr.join(''); 530 let numstr = parseInt(substr); 531 console.info('the value of the bufferstr is :' + numstr); 532 expect(majorVersionInfo).assertEqual(numstr); 533 } else { 534 console.info('the return value is null or incorrect.'); 535 expect(false).assertFalse(); 536 } 537 538 console.info('testGetMajorVersion01 :end'); 539 }) 540 541 /** 542 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0210 543 * @tc.name testGetSeniorVersion01 544 * @tc.desc Get the senior version number and the return value is greater than 0. 545 * @tc.size : MEDIUM 546 * @tc.type : Function 547 * @tc.level : Level 0 548 */ 549 it('device_info_test_019', 0, function () { 550 console.info('testGetSeniorVersion01 start'); 551 552 let seniorVersionInfo = deviceinfo.seniorVersion; 553 console.info('the value of the deviceinfo seniorVersion is :' + seniorVersionInfo); 554 555 expect(seniorVersionInfo).assertInstanceOf('Number'); 556 if (seniorVersionInfo >= 0 && seniorVersionInfo <= 99) { 557 let str = /[\w-\.\(\)]/g; 558 let arr = seniorVersionInfo.toString().match(str); 559 let substr = arr.join(''); 560 let numstr = parseInt(substr); 561 console.info('the value of the bufferstr is :' + numstr); 562 expect(seniorVersionInfo).assertEqual(numstr); 563 } else { 564 console.info('the return value is null or incorrect.'); 565 expect(false).assertFalse(); 566 } 567 568 console.info('testGetSeniorVersion01 :end'); 569 }) 570 571 /** 572 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0220 573 * @tc.name testGetFeatureVersion01 574 * @tc.desc Get the feature (F) version number which the return value is greater than 0. 575 * @tc.size : MEDIUM 576 * @tc.type : Function 577 * @tc.level : Level 0 578 */ 579 it('device_info_test_020', 0, function () { 580 console.info('testGetFeatureVersion01 start'); 581 582 let featureVersionInfo = deviceinfo.featureVersion; 583 console.info('the value of the deviceinfo featureVersion is :' + featureVersionInfo); 584 585 expect(featureVersionInfo).assertInstanceOf('Number'); 586 if ((featureVersionInfo >= 1 && featureVersionInfo <= 99) || featureVersionInfo == 0) { 587 let str = /[\w-\.\(\)]/g; 588 let arr = featureVersionInfo.toString().match(str); 589 let substr = arr.join(''); 590 let numstr = parseInt(substr); 591 console.info('the value of the bufferstr is :' + numstr); 592 expect(featureVersionInfo).assertEqual(numstr); 593 } else { 594 console.info('the return value is null or incorrect.'); 595 expect(false).assertFalse(); 596 } 597 598 console.info('testGetFeatureVersion01 :end'); 599 }) 600 601 /** 602 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0230 603 * @tc.name testGetBuildVersion01 604 * @tc.desc Get the build (B) version number which the return value is greater than 0. 605 * @tc.size : MEDIUM 606 * @tc.type : Function 607 * @tc.level : Level 0 608 */ 609 it('device_info_test_021', 0, function () { 610 console.info('testGetBuildVersion01 start'); 611 612 let buildVersionInfo = deviceinfo.buildVersion; 613 console.info('the value of the deviceinfo buildVersion is :' + buildVersionInfo); 614 615 expect(buildVersionInfo).assertInstanceOf('Number'); 616 if (buildVersionInfo == 0 || (buildVersionInfo >= 1 && buildVersionInfo <= 999)) { 617 let str = /[\w-\.\(\)]/g; 618 let arr = buildVersionInfo.toString().match(str); 619 let substr = arr.join(''); 620 let numstr = parseInt(substr); 621 console.info('the value of the bufferstr is :' + numstr); 622 expect(buildVersionInfo).assertEqual(numstr); 623 } else { 624 console.info('the return value is null or incorrect.'); 625 expect(false).assertFalse(); 626 } 627 628 console.info('testGetBuildVersion01 :end'); 629 }) 630 631 /** 632 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0240 633 * @tc.name testGetSdkApiVersion01 634 * @tc.desc Get the API version number, which return value type is number and return value is greater than 0. 635 * @tc.size : MEDIUM 636 * @tc.type : Function 637 * @tc.level : Level 0 638 */ 639 it('device_info_test_022', 0, function () { 640 console.info('testGetSdkApiVersion01 start'); 641 let ret = false; 642 let sdkApiVersionInfo = deviceinfo.sdkApiVersion; 643 console.info('the value of the deviceinfo sdkApiVersion is :' + sdkApiVersionInfo); 644 645 expect(sdkApiVersionInfo).assertInstanceOf('Number'); 646 if (sdkApiVersionInfo >= 0) { 647 ret = true; 648 } 649 expect(ret).assertTrue(); 650 651 let str = /[\w-\.\(\)]/g; 652 let arr = sdkApiVersionInfo.toString().match(str); 653 let substr = arr.join(''); 654 let numstr = parseInt(substr); 655 console.info('the value of the bufferstr is :' + numstr); 656 expect(sdkApiVersionInfo).assertEqual(numstr); 657 658 console.info('testGetSdkApiVersion01 :end'); 659 }) 660 661 /** 662 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0250 663 * @tc.name testGetFirstApiVersion01 664 * @tc.desc Get the first API version number which the return value is greater than 0. 665 * @tc.size : MEDIUM 666 * @tc.type : Function 667 * @tc.level : Level 0 668 */ 669 it('device_info_test_023', 0, function () { 670 console.info('testGetFirstApiVersion01 start'); 671 let ret = true; 672 let firstApiVersionInfo = deviceinfo.firstApiVersion; 673 console.info('the value of the deviceinfo firstApiVersion is :' + firstApiVersionInfo); 674 675 expect(firstApiVersionInfo).assertInstanceOf('Number'); 676 if (firstApiVersionInfo >= 0) { 677 ret = true; 678 } 679 expect(ret).assertTrue(); 680 681 let str = /[\w-\.\(\)]/g; 682 let arr = firstApiVersionInfo.toString().match(str); 683 let substr = arr.join(''); 684 let numstr = parseInt(substr); 685 console.info('the value of the bufferstr is :' + numstr); 686 expect(firstApiVersionInfo).assertEqual(numstr); 687 688 console.info('testGetFirstApiVersion01 :end'); 689 }) 690 691 /** 692 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0260 693 * @tc.name testGetVersionId01 694 * @tc.desc Get the version ID number by a string which the return value is not null. 695 * @tc.size : MEDIUM 696 * @tc.type : Function 697 * @tc.level : Level 0 698 */ 699 it('device_info_test_024', 0, function () { 700 console.info('testGetVersionId01 start'); 701 let ret = false; 702 let versionIdInfo = deviceinfo.versionId; 703 console.info('the value of the deviceinfo versionId is :' + versionIdInfo); 704 705 expect(versionIdInfo).assertInstanceOf('String'); 706 if (versionIdInfo != "" && versionIdInfo != null && versionIdInfo != undefined) { 707 ret = true; 708 } 709 expect(ret).assertTrue(); 710 console.info('testGetVersionId01 end'); 711 }) 712 713 /** 714 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0270 715 * @tc.name testGetBuildType01 716 * @tc.desc Get the different build types of the same baseline code which the return value is not null. 717 * @tc.size : MEDIUM 718 * @tc.type : Function 719 * @tc.level : Level 0 720 */ 721 it('device_info_test_025', 0, function () { 722 console.info('testGetBuildType01 start'); 723 724 let buildTypeInfo = deviceinfo.buildType; 725 console.info('the value of the deviceinfo buildType is :' + buildTypeInfo); 726 727 expect(buildTypeInfo).assertInstanceOf('String'); 728 if (buildTypeInfo != "" && buildTypeInfo != null && buildTypeInfo != undefined) { 729 let str = /[\w-\.\(\)\:]/g; 730 let arr = buildTypeInfo.match(str); 731 let bufferstr = arr.join(''); 732 console.info('the value of the bufferstr is :' + bufferstr); 733 expect(buildTypeInfo).assertEqual(bufferstr); 734 } else { 735 console.info('the return value is null or incorrect.'); 736 expect(false).assertFalse(); 737 } 738 739 console.info('testGetBuildType01 :end'); 740 }) 741 742 /** 743 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0280 744 * @tc.name testGetBuildUser01 745 * @tc.desc Get the different build user by a string which the return value is not null. 746 * @tc.size : MEDIUM 747 * @tc.type : Function 748 * @tc.level : Level 0 749 */ 750 it('device_info_test_026', 0, function () { 751 console.info('testGetBuildUser01 start'); 752 let ret = true; 753 let buildUserInfo = deviceinfo.buildUser; 754 console.info('the value of the deviceinfo buildUser is :' + buildUserInfo); 755 756 expect(buildUserInfo).assertInstanceOf('String'); 757 if (buildUserInfo != "" && buildUserInfo != null && buildUserInfo != undefined) { 758 ret = true; 759 } 760 expect(ret).assertTrue(); 761 console.info('testGetBuildUser01 :end'); 762 }) 763 764 /** 765 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0290 766 * @tc.name testGetBuildHost01 767 * @tc.desc Get the build host of the same baseline code by a string and the return value is not null. 768 * @tc.size : MEDIUM 769 * @tc.type : Function 770 * @tc.level : Level 0 771 */ 772 it('device_info_test_027', 0, function () { 773 console.info('testGetBuildHost01 start'); 774 let ret = false; 775 let buildHostInfo = deviceinfo.buildHost; 776 console.info('the value of the deviceinfo buildHost is :' + buildHostInfo); 777 778 expect(buildHostInfo).assertInstanceOf('String'); 779 if (buildHostInfo != "" && buildHostInfo != null && buildHostInfo != undefined) { 780 ret = true; 781 } 782 expect(ret).assertTrue(); 783 console.info('testGetBuildHost01 :end'); 784 }) 785 786 /** 787 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0310 788 * @tc.name testGetBuildTime01 789 * @tc.desc Get the version build time by a string and the return value is not null. 790 * @tc.size : MEDIUM 791 * @tc.type : Function 792 * @tc.level : Level 0 793 */ 794 it('device_info_test_028', 0, function () { 795 console.info('testGetBuildTime01 start'); 796 let ret = false; 797 let buildTimeInfo = deviceinfo.buildTime; 798 console.info('the value of the deviceinfo buildTime is :' + buildTimeInfo); 799 800 expect(buildTimeInfo).assertInstanceOf('String'); 801 if (buildTimeInfo != "" && buildTimeInfo != null && buildTimeInfo != undefined) { 802 ret = true; 803 } 804 expect(ret).assertTrue(); 805 console.info('testGetBuildTime01 : end'); 806 }) 807 808 /** 809 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0320 810 * @tc.name testGetBuildRootHash01 811 * @tc.desc Get the version hash by a string and the return value is not null. 812 * @tc.size : MEDIUM 813 * @tc.type : Function 814 * @tc.level : Level 0 815 */ 816 it('device_info_test_029', 0, function () { 817 console.info('testGetBuildRootHash01 start'); 818 819 let buildRootHashInfo = deviceinfo.buildRootHash; 820 console.info('the value of the deviceinfo buildRootHash is :' + buildRootHashInfo); 821 822 expect(buildRootHashInfo).assertInstanceOf('String'); 823 if (buildRootHashInfo != "" && buildRootHashInfo != null && buildRootHashInfo != undefined) { 824 let str = /[\w-\.\(\)]/g; 825 let arr = buildRootHashInfo.match(str); 826 let bufferstr = arr.join(''); 827 console.info('the value of the bufferstr is :' + bufferstr); 828 expect(buildRootHashInfo).assertEqual(bufferstr); 829 } else { 830 console.info('the return value is null or incorrect.'); 831 expect(false).assertFalse(); 832 } 833 834 console.info('testGetBuildRootHash01 :end'); 835 }) 836 837 /** 838 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0330 839 * @tc.name testGetDeviceType02 840 * @tc.desc Get a string representing the device type which has a maximum of 32 characters. 841 * @tc.size : MEDIUM 842 * @tc.type : Function 843 * @tc.level : Level 0 844 */ 845 it('device_info_test_030', 0, function () { 846 console.info('device_info_test_030 start'); 847 let deviceTypeInfo = deviceinfo.deviceType; 848 console.info('the value of the deviceinfo deviceType is:' + deviceTypeInfo); 849 850 let len = deviceTypeInfo.length 851 852 console.info('the value of the device type characters:' + len); 853 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE) 854 console.info('device_info_test_030 : end') 855 }) 856 857 /** 858 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0340 859 * @tc.name testGetManufacture02 860 * @tc.desc Get a string representing the manufacture which has a maximum of 32 characters. 861 * @tc.size : MEDIUM 862 * @tc.type : Function 863 * @tc.level : Level 0 864 */ 865 it('device_info_test_031', 0, function () { 866 console.info('device_info_test_031 start'); 867 let manufactureInfo = deviceinfo.manufacture; 868 console.info('the value of the deviceinfo manufacture is :' + manufactureInfo); 869 870 let len = manufactureInfo.length 871 console.info('the value of the manufacture characters is :' + len); 872 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 873 874 let str = /[\w-\.\(\)]/g; 875 let arr = manufactureInfo.match(str); 876 let bufferstr = arr.join(''); 877 console.info('the value of the bufferstr is :' + bufferstr); 878 expect(manufactureInfo).assertEqual(bufferstr); 879 880 console.info('device_info_test_031 :end') 881 }) 882 883 /** 884 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0350 885 * @tc.name testGetDeviceBrand02 886 * @tc.desc Get a string representing the external product family name which has a maximum of 32 characters. 887 * @tc.size : MEDIUM 888 * @tc.type : Function 889 * @tc.level : Level 0 890 */ 891 it('device_info_test_032', 0, function () { 892 console.info('device_info_test_032 start'); 893 let brandInfo = deviceinfo.brand; 894 console.info('the value of the deviceinfo brand is :' + brandInfo); 895 896 let len = brandInfo.length 897 console.info('the value of the external product family name characters is :' + len); 898 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 899 900 let str = /[\w-\.\(\)]/g; 901 let arr = brandInfo.match(str); 902 let bufferstr = arr.join(''); 903 console.info('the value of the bufferstr is :' + bufferstr); 904 expect(brandInfo).assertEqual(bufferstr); 905 906 console.info('device_info_test_032 :end') 907 }) 908 909 /** 910 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0360 911 * @tc.name testGetMarketName02 912 * @tc.desc Get a string representing the product series which has a maximum of 32 characters. 913 * @tc.size : MEDIUM 914 * @tc.type : Function 915 * @tc.level : Level 0 916 */ 917 it('device_info_test_033', 0, function () { 918 console.info('device_info_test_033 start'); 919 let marketNameInfo = deviceinfo.marketName; 920 console.info('the value of the deviceinfo marketName is :' + marketNameInfo); 921 922 let len = marketNameInfo.length 923 console.info('the value of the product series characters is :' + len); 924 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE) 925 console.info('device_info_test_033 : end') 926 }) 927 928 /** 929 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0370 930 * @tc.name testGetProductSeries02 931 * @tc.desc Get a string representing the product series which has a maximum of 32 characters. 932 * @tc.size : MEDIUM 933 * @tc.type : Function 934 * @tc.level : Level 0 935 */ 936 it('device_info_test_034', 0, function () { 937 console.info('device_info_test_034 start'); 938 let productSeriesInfo = deviceinfo.productSeries; 939 console.info('the value of the deviceinfo productSeries is :' + productSeriesInfo); 940 941 let str = /[\w-\.\(\)\s]/g; 942 let len = productSeriesInfo.length 943 console.info('the value of the product series characters is :' + len); 944 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 945 946 let arr = productSeriesInfo.match(str); 947 let bufferstr = arr.join(''); 948 console.info('the value of the bufferstr is :' + bufferstr); 949 expect(productSeriesInfo).assertEqual(bufferstr); 950 951 console.info('device_info_test_034 :end'); 952 }) 953 954 /** 955 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0380 956 * @tc.name testGetProductModel02 957 * @tc.desc Get a string representing the certified model which has a maximum of 32 characters. 958 * @tc.size : MEDIUM 959 * @tc.type : Function 960 * @tc.level : Level 0 961 */ 962 it('device_info_test_035', 0, function () { 963 console.info('device_info_test_035 start'); 964 let productModelInfo = deviceinfo.productModel; 965 console.info('the value of the deviceinfo productModel is :' + productModelInfo); 966 967 let len = productModelInfo.length 968 console.info('the value of the certified model characters is :' + len); 969 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE) 970 console.info('device_info_test_035 : end') 971 }) 972 973 /** 974 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0390 975 * @tc.name testGetSoftwareModel02 976 * @tc.desc Get a string representing the internal software sub-model which has a maximum of 32 characters. 977 * @tc.size : MEDIUM 978 * @tc.type : Function 979 * @tc.level : Level 0 980 */ 981 it('device_info_test_036', 0, function () { 982 console.info('device_info_test_036 start'); 983 let softwareModelInfo = deviceinfo.softwareModel; 984 console.info('the value of the deviceinfo softwareModel is :' + softwareModelInfo); 985 986 let len = softwareModelInfo.length 987 console.info('the value of the internal software sub-model characters is :' + len); 988 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 989 990 let str = /[\w-\.\(\)\s]/g; 991 let arr = softwareModelInfo.match(str); 992 let bufferstr = arr.join(''); 993 console.info('the value of the bufferstr is :' + bufferstr); 994 expect(softwareModelInfo).assertEqual(bufferstr); 995 996 console.info('device_info_test_036 :end') 997 }) 998 999 /** 1000 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0410 1001 * @tc.name testGetHardwareModel02 1002 * @tc.desc Get a string representing the hardware version which has a maximum of 32 characters. 1003 * @tc.size : MEDIUM 1004 * @tc.type : Function 1005 * @tc.level : Level 0 1006 */ 1007 it('device_info_test_037', 0, function () { 1008 console.info('device_info_test_037 start'); 1009 let hardwareModelInfo = deviceinfo.hardwareModel; 1010 console.info('the value of the deviceinfo hardwareModel is :' + hardwareModelInfo); 1011 1012 let len = hardwareModelInfo.length; 1013 console.info('the value of the hardware version characters is :' + len); 1014 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 1015 1016 let str = /[\w-\.\(\)]/g; 1017 let arr = hardwareModelInfo.match(str); 1018 let bufferstr = arr.join(''); 1019 console.info('the value of the bufferstr is :' + bufferstr); 1020 expect(hardwareModelInfo).assertEqual(bufferstr); 1021 1022 console.info('device_info_test_037 :end'); 1023 }) 1024 1025 /** 1026 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0420 1027 * @tc.name testGetHardwareProfile02 1028 * @tc.desc Get a string representing the hardware version which has a maximum of 1000 characters. 1029 * @tc.size : MEDIUM 1030 * @tc.type : Function 1031 * @tc.level : Level 0 1032 */ 1033 it('device_info_test_038', 0, function () { 1034 console.info('device_info_test_038 start'); 1035 let hardwareProfileInfo = deviceinfo.hardwareProfile; 1036 console.info('the value of the deviceinfo hardwareProfile is :' + hardwareProfileInfo); 1037 1038 let str = /[\w-\.\(\)]/g; 1039 let len = hardwareProfileInfo.length; 1040 console.info('the value of the hardware version characters is :' + len); 1041 expect(len).assertLess(1001); 1042 1043 let arr = hardwareProfileInfo.match(str); 1044 let bufferstr = arr.join(''); 1045 console.info('the value of the bufferstr is :' + bufferstr); 1046 expect(hardwareProfileInfo).assertEqual(bufferstr); 1047 1048 console.info('device_info_test_038 :end'); 1049 }) 1050 1051 /** 1052 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0430 1053 * @tc.name testGetSerial02 1054 * @tc.desc Get a string representing the device serial number which has a maximum of 64 characters. 1055 * @tc.size : MEDIUM 1056 * @tc.type : Function 1057 * @tc.level : Level 0 1058 */ 1059 it('device_info_test_039', 0, function () { 1060 console.info('device_info_test_039 start'); 1061 let serialInfo = deviceinfo.serial; 1062 console.info('the value of the deviceinfo serial is :' + serialInfo); 1063 1064 let len = serialInfo.length; 1065 console.info('the value of the device serial number characters is :' + len); 1066 expect(len).assertLess(MAX_CHARACTERS_NUM_TWO); 1067 1068 let str = /[\w-\.\(\)]/g; 1069 let arr = serialInfo.match(str); 1070 let bufferstr = arr.join(''); 1071 console.info('the value of the bufferstr is :' + bufferstr); 1072 expect(serialInfo).assertEqual(bufferstr); 1073 1074 console.info('device_info_test_039 :end'); 1075 }) 1076 1077 /** 1078 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0440 1079 * @tc.name testGetDisplayVersion02 1080 * @tc.desc Get a string representing the version number visible to users which has a maximum of 64 characters. 1081 * @tc.size : MEDIUM 1082 * @tc.type : Function 1083 * @tc.level : Level 0 1084 */ 1085 it('device_info_test_040', 0, function () { 1086 console.info('device_info_test_040 start'); 1087 let displayVersionInfo = deviceinfo.displayVersion; 1088 console.info('the value of the deviceinfo displayVersion is :' + displayVersionInfo); 1089 1090 let len = displayVersionInfo.length; 1091 console.info('the value of the device serial number characters is :' + len); 1092 expect(len).assertLess(MAX_CHARACTERS_NUM_TWO); 1093 console.info('device_info_test_040 :end'); 1094 }) 1095 1096 /** 1097 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0450 1098 * @tc.name testGetOsFullName02 1099 * @tc.desc Get a string representing the operating system full name which has a maximum of 32 characters. 1100 * @tc.size : MEDIUM 1101 * @tc.type : Function 1102 * @tc.level : Level 0 1103 */ 1104 it('device_info_test_041', 0, function () { 1105 console.info('device_info_test_041 start'); 1106 let osFullNameInfo = deviceinfo.osFullName; 1107 console.info('the value of the deviceinfo osFullName is :' + osFullNameInfo); 1108 1109 let len = osFullNameInfo.length; 1110 console.info('the value of the operating system full name characters is :' + len); 1111 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 1112 1113 let str = /[\w-\.\(\)]/g; 1114 let arr = osFullNameInfo.match(str); 1115 let bufferstr = arr.join(''); 1116 console.info('the value of the bufferstr is :' + bufferstr); 1117 expect(osFullNameInfo).assertEqual(bufferstr); 1118 1119 console.info('device_info_test_041 :end'); 1120 }) 1121 1122 /** 1123 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0460 1124 * @tc.name testGetVersionId02 1125 * @tc.desc Get a string representing the operating system full name which has a maximum of 127 characters. 1126 * @tc.size : MEDIUM 1127 * @tc.type : Function 1128 * @tc.level : Level 0 1129 */ 1130 it('device_info_test_042', 0, function () { 1131 console.info('device_info_test_042 start'); 1132 let versionIdInfo = deviceinfo.versionId; 1133 console.info('the value of the deviceinfo versionId is :' + versionIdInfo); 1134 1135 let len = versionIdInfo.length; 1136 console.info('the value of the operating system full name characters is :' + len) 1137 expect(len).assertLess(128); 1138 console.info('device_info_test_042 : end') 1139 }) 1140 1141 /** 1142 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0470 1143 * @tc.name testGetBuildUser02 1144 * @tc.desc Get a string representing the different build user of the same baseline code which has a maximum of 32 characters. 1145 * @tc.size : MEDIUM 1146 * @tc.type : Function 1147 * @tc.level : Level 0 1148 */ 1149 it('device_info_test_043', 0, function () { 1150 console.info('device_info_test_043 start'); 1151 let buildUserInfo = deviceinfo.buildUser; 1152 console.info('the value of the deviceinfo buildUser is :' + buildUserInfo); 1153 1154 console.info('the value of the different build user of the same baseline code characters is :' + buildUserInfo.length); 1155 expect(buildUserInfo.length).assertLess(MAX_CHARACTERS_NUM_ONE); 1156 1157 let str = /[\w-\.\(\)]/g; 1158 let arr = buildUserInfo.match(str); 1159 let bufferstr = arr.join(''); 1160 console.info('the value of the bufferstr is :' + bufferstr); 1161 expect(buildUserInfo).assertEqual(bufferstr); 1162 1163 console.info('device_info_test_043 :end') 1164 }) 1165 1166 /** 1167 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0480 1168 * @tc.name testGetBuildHost02 1169 * @tc.desc Get a string representing the different build host of the same baseline code which has a maximum of 32 characters. 1170 * @tc.size : MEDIUM 1171 * @tc.type : Function 1172 * @tc.level : Level 0 1173 */ 1174 it('device_info_test_044', 0, function () { 1175 console.info('device_info_test_044 start'); 1176 let buildHostInfo = deviceinfo.buildHost; 1177 console.info('the value of the deviceinfo buildHost is :' + buildHostInfo); 1178 1179 let len = buildHostInfo.length 1180 console.info('the value of the different build host of the same baseline code characters is :' + len) 1181 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 1182 1183 let str = /[\w-\.\(\)]/g; 1184 let arr = buildHostInfo.match(str); 1185 let bufferstr = arr.join(''); 1186 console.info('the value of the bufferstr is :' + bufferstr); 1187 expect(buildHostInfo).assertEqual(bufferstr); 1188 1189 console.info('device_info_test_044 :end') 1190 }) 1191 1192 /** 1193 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0490 1194 * @tc.name testGetDeviceType03 1195 * @tc.desc Get a string representing the device type which has at least one characters. 1196 * @tc.size : MEDIUM 1197 * @tc.type : Function 1198 * @tc.level : Level 0 1199 */ 1200 it('device_info_test_045', 0, function () { 1201 console.info('device_info_test_045 start'); 1202 let deviceTypeInfo = deviceinfo.deviceType; 1203 console.info('the value of the deviceinfo deviceType is :' + deviceTypeInfo); 1204 1205 let len = deviceTypeInfo.length; 1206 console.info('the value of the device type characters:' + len); 1207 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1208 console.info('device_info_test_045 : end'); 1209 }) 1210 1211 /** 1212 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0510 1213 * @tc.name testGetManufacture03 1214 * @tc.desc Get a string representing the manufacture which has at least one characters. 1215 * @tc.size : MEDIUM 1216 * @tc.type : Function 1217 * @tc.level : Level 0 1218 */ 1219 it('device_info_test_046', 0, function () { 1220 console.info('device_info_test_046 start'); 1221 let manufactureInfo = deviceinfo.manufacture; 1222 console.info('the value of the deviceinfo manufacture is :' + manufactureInfo); 1223 1224 let len = manufactureInfo.length 1225 console.info('the value of the manufacture characters is :' + len) 1226 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1227 1228 let str = /[\w-\.\(\)]/g; 1229 let arr = manufactureInfo.match(str); 1230 let bufferstr = arr.join(''); 1231 console.info('the value of the bufferstr is :' + bufferstr); 1232 expect(manufactureInfo).assertEqual(bufferstr); 1233 1234 console.info('device_info_test_046 :end') 1235 }) 1236 1237 /** 1238 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0520 1239 * @tc.name testGetProductBrand03 1240 * @tc.desc Get a string representing the external product family name which has at least one characters. 1241 * @tc.size : MEDIUM 1242 * @tc.type : Function 1243 * @tc.level : Level 0 1244 */ 1245 it('device_info_test_047', 0, function () { 1246 console.info('device_info_test_047 start'); 1247 let brandInfo = deviceinfo.brand; 1248 console.info('the value of the deviceinfo brand is :' + brandInfo); 1249 1250 let len = brandInfo.length; 1251 console.info('the value of the external product family name characters is :' + len); 1252 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1253 1254 let str = /[\w-\.\(\)]/g; 1255 let arr = brandInfo.match(str); 1256 let bufferstr = arr.join(''); 1257 console.info('the value of the bufferstr is :' + bufferstr); 1258 expect(brandInfo).assertEqual(bufferstr); 1259 1260 console.info('device_info_test_047 :end'); 1261 }) 1262 1263 /** 1264 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0530 1265 * @tc.name testGetMarketName03 1266 * @tc.desc Get a string representing the product series which has at least one characters. 1267 * @tc.size : MEDIUM 1268 * @tc.type : Function 1269 * @tc.level : Level 0 1270 */ 1271 it('device_info_test_048', 0, function () { 1272 console.info('device_info_test_048 start'); 1273 let marketNameInfo = deviceinfo.marketName; 1274 console.info('the value of the deviceinfo marketName is :' + marketNameInfo); 1275 1276 let len = marketNameInfo.length; 1277 console.info('the value of the product series characters is :' + len) 1278 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1279 console.info('device_info_test_048 :end'); 1280 }) 1281 1282 1283 /** 1284 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0540 1285 * @tc.name testGetProductSeries03 1286 * @tc.desc Get a string representing the product series which has at least one characters. 1287 * @tc.size : MEDIUM 1288 * @tc.type : Function 1289 * @tc.level : Level 0 1290 */ 1291 it('device_info_test_049', 0, function () { 1292 console.info('device_info_test_049 start'); 1293 let productSeriesInfo = deviceinfo.productSeries; 1294 console.info('the value of the deviceinfo productSeries is :' + productSeriesInfo); 1295 1296 let len = productSeriesInfo.length; 1297 console.info('the value of the product series characters is :' + len); 1298 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1299 1300 let str = /[\w-\.\(\)\s]/g; 1301 let arr = productSeriesInfo.match(str); 1302 let bufferstr = arr.join(''); 1303 console.info('the value of the bufferstr is :' + bufferstr); 1304 expect(productSeriesInfo).assertEqual(bufferstr); 1305 1306 console.info('device_info_test_049 :end'); 1307 }) 1308 1309 /** 1310 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0550 1311 * @tc.name testGetProductModel03 1312 * @tc.desc Get a string representing the certified model which has at least one characters. 1313 * @tc.size : MEDIUM 1314 * @tc.type : Function 1315 * @tc.level : Level 0 1316 */ 1317 it('device_info_test_050', 0, function () { 1318 console.info('device_info_test_050 start'); 1319 let productModelInfo = deviceinfo.productModel; 1320 console.info('the value of the deviceinfo productModel is :' + productModelInfo); 1321 1322 let len = productModelInfo.length 1323 console.info('the value of the certified model characters is :' + len) 1324 expect(len).assertLarger(MAX_CHARACTERS_NUM) 1325 console.info('device_info_test_050 : end') 1326 }) 1327 1328 /** 1329 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0560 1330 * @tc.name testGetSoftwareModel03 1331 * @tc.desc Get a string representing the internal software sub-model which has at least one characters. 1332 * @tc.size : MEDIUM 1333 * @tc.type : Function 1334 * @tc.level : Level 0 1335 */ 1336 it('device_info_test_051', 0, function () { 1337 console.info('device_info_test_051 start'); 1338 let softwareModelInfo = deviceinfo.softwareModel; 1339 console.info('the value of the deviceinfo softwareModel is :' + softwareModelInfo); 1340 1341 let len = softwareModelInfo.length 1342 console.info('the value of the internal software sub-model characters is :' + len) 1343 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1344 1345 let str = /[\w-\.\(\)\s]/g; 1346 let arr = softwareModelInfo.match(str); 1347 let bufferstr = arr.join(''); 1348 console.info('the value of the bufferstr is :' + bufferstr); 1349 expect(softwareModelInfo).assertEqual(bufferstr); 1350 1351 console.info('device_info_test_051 :end') 1352 }) 1353 1354 /** 1355 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0570 1356 * @tc.name testGetHardwareModel03 1357 * @tc.desc Get a string representing the hardware version which has at least one characters. 1358 * @tc.size : MEDIUM 1359 * @tc.type : Function 1360 * @tc.level : Level 0 1361 */ 1362 it('device_info_test_052', 0, function () { 1363 console.info('device_info_test_052 start'); 1364 let hardwareModelInfo = deviceinfo.hardwareModel; 1365 console.info('the value of the deviceinfo hardwareModel is :' + hardwareModelInfo); 1366 1367 let len = hardwareModelInfo.length; 1368 console.info('the value of the hardware version characters is :' + len); 1369 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1370 1371 let str = /[\w-\.\(\)]/g; 1372 let arr = hardwareModelInfo.match(str); 1373 let bufferstr = arr.join(''); 1374 console.info('the value of the bufferstr is :' + bufferstr); 1375 expect(hardwareModelInfo).assertEqual(bufferstr); 1376 1377 console.info('device_info_test_052 :end'); 1378 }) 1379 1380 /** 1381 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0580 1382 * @tc.name testGetHardwareProfile03 1383 * @tc.desc Get a string representing the hardware version which has at least one characters. 1384 * @tc.size : MEDIUM 1385 * @tc.type : Function 1386 * @tc.level : Level 0 1387 */ 1388 it('device_info_test_053', 0, function () { 1389 console.info('device_info_test_053 start'); 1390 let hardwareProfileInfo = deviceinfo.hardwareProfile; 1391 console.info('the value of the deviceinfo hardwareProfile is :' + hardwareProfileInfo); 1392 1393 let len = hardwareProfileInfo.length; 1394 console.info('the value of the hardware version characters is :' + len); 1395 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1396 1397 let str = /[\w-\.\(\)]/g; 1398 let arr = hardwareProfileInfo.match(str); 1399 let bufferstr = arr.join(''); 1400 console.info('the value of the bufferstr is :' + bufferstr); 1401 expect(hardwareProfileInfo).assertEqual(bufferstr); 1402 1403 console.info('device_info_test_053 :end'); 1404 }) 1405 1406 /** 1407 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0590 1408 * @tc.name testGetSerial03 1409 * @tc.desc Get a string representing the device serial number which has at least one characters. 1410 * @tc.size : MEDIUM 1411 * @tc.type : Function 1412 * @tc.level : Level 0 1413 */ 1414 it('device_info_test_054', 0, function () { 1415 console.info('device_info_test_054 start'); 1416 let serialInfo = deviceinfo.serial; 1417 console.info('the value of the deviceinfo serial is :' + serialInfo); 1418 1419 let len = serialInfo.length; 1420 console.info('the value of the device serial number characters is :' + len); 1421 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1422 1423 let str = /[\w-\.\(\)]/g; 1424 let arr = serialInfo.match(str); 1425 let bufferstr = arr.join(''); 1426 console.info('the value of the bufferstr is :' + bufferstr); 1427 expect(serialInfo).assertEqual(bufferstr); 1428 1429 console.info('device_info_test_054 :end'); 1430 }) 1431 1432 /** 1433 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0610 1434 * @tc.name testGetDisplayVersion03 1435 * @tc.desc Get a string representing the version number visible to users which has at least one characters. 1436 * @tc.size : MEDIUM 1437 * @tc.type : Function 1438 * @tc.level : Level 0 1439 */ 1440 it('device_info_test_055', 0, function () { 1441 console.info('device_info_test_055 start'); 1442 let displayVersionInfo = deviceinfo.displayVersion; 1443 console.info('the value of the deviceinfo displayVersion is :' + displayVersionInfo); 1444 1445 let len = displayVersionInfo.length; 1446 console.info('the value of the device serial number characters is :' + len); 1447 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1448 1449 console.info('device_info_test_055 :end'); 1450 }) 1451 1452 /** 1453 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0620 1454 * @tc.name testGetIncrementalVersionInfo02 1455 * @tc.desc Get a string representing the version number visible to users which has a maximum of 32 characters. 1456 * @tc.size : MEDIUM 1457 * @tc.type : Function 1458 * @tc.level : Level 0 1459 */ 1460 it('device_info_test_056', 0, function () { 1461 console.info('device_info_test_056 start'); 1462 let incrementalVersionInfo = deviceinfo.incrementalVersion; 1463 console.info('the value of the deviceinfo incrementalVersion is :' + incrementalVersionInfo); 1464 1465 let len = incrementalVersionInfo.length 1466 console.info('the value of the device serial number characters is :' + len) 1467 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 1468 1469 let str = /[\w-\.\(\)]/g; 1470 let arr = incrementalVersionInfo.match(str); 1471 let bufferstr = arr.join(''); 1472 console.info('the value of the bufferstr is :' + bufferstr); 1473 expect(incrementalVersionInfo).assertEqual(bufferstr); 1474 1475 console.info('device_info_test_056 :end') 1476 }) 1477 1478 /** 1479 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0630 1480 * @tc.name testGetIncrementalVersionInfo03 1481 * @tc.desc Get a string representing the version number visible to users which has at least one characters. 1482 * @tc.size : MEDIUM 1483 * @tc.type : Function 1484 * @tc.level : Level 0 1485 */ 1486 it('device_info_test_057', 0, function () { 1487 console.info('device_info_test_057 start'); 1488 let incrementalVersionInfo = deviceinfo.incrementalVersion; 1489 console.info('the value of the deviceinfo incrementalVersion is :' + incrementalVersionInfo); 1490 1491 let len = incrementalVersionInfo.length 1492 console.info('the value of the device serial number characters is :' + len) 1493 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1494 1495 let str = /[\w-\.\(\)]/g; 1496 let arr = incrementalVersionInfo.match(str); 1497 let bufferstr = arr.join(''); 1498 console.info('the value of the bufferstr is :' + bufferstr); 1499 expect(incrementalVersionInfo).assertEqual(bufferstr); 1500 1501 console.info('device_info_test_057 :end') 1502 }) 1503 1504 /** 1505 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0640 1506 * @tc.name testGetVersionId03 1507 * @tc.desc Get a string representing the operating system full name which has at least one characters. 1508 * @tc.size : MEDIUM 1509 * @tc.type : Function 1510 * @tc.level : Level 0 1511 */ 1512 it('device_info_test_058', 0, function () { 1513 console.info('device_info_test_058 start'); 1514 let versionIdInfo = deviceinfo.versionId; 1515 console.info('the value of the deviceinfo versionId is :' + versionIdInfo); 1516 1517 let len = versionIdInfo.length 1518 console.info('the value of the operating system full name characters is :' + len) 1519 expect(len).assertLarger(MAX_CHARACTERS_NUM) 1520 console.info('device_info_test_058 : end') 1521 }) 1522 1523 /** 1524 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0650 1525 * @tc.name testGetBuildUser03 1526 * @tc.desc Get a string representing the different build user of the same baseline code which has at least one characters. 1527 * @tc.size : MEDIUM 1528 * @tc.type : Function 1529 * @tc.level : Level 0 1530 */ 1531 it('device_info_test_059', 0, function () { 1532 console.info('device_info_test_043 start'); 1533 let buildUserInfo = deviceinfo.buildUser; 1534 console.info('the value of thebuildUser is :' + buildUserInfo); 1535 1536 console.info('the value of the different build user of the same baseline code characters is :' + buildUserInfo.length); 1537 expect(buildUserInfo.length).assertLarger(MAX_CHARACTERS_NUM); 1538 1539 console.info('device_info_test_059 :end') 1540 }) 1541 1542 /** 1543 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0660 1544 * @tc.name testGetBuildHost03 1545 * @tc.desc Get a string representing the different build host of the same baseline code which has at least one characters. 1546 * @tc.size : MEDIUM 1547 * @tc.type : Function 1548 * @tc.level : Level 0 1549 */ 1550 it('device_info_test_060', 0, function () { 1551 console.info('device_info_test_060 start'); 1552 let buildHostInfo = deviceinfo.buildHost; 1553 console.info('the value of the deviceinfo buildHost is :' + buildHostInfo); 1554 1555 let len = buildHostInfo.length 1556 console.info('the value of the different build host of the same baseline code characters is :' + len); 1557 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1558 console.info('device_info_test_060 :end'); 1559 }) 1560 1561 /** 1562 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0670 1563 * @tc.name testGetSecurityPatchTag02 1564 * @tc.desc Get security pactch tag which format is yy--mm--dd test. 1565 * @tc.size : MEDIUM 1566 * @tc.type : Function 1567 * @tc.level : Level 0 1568 */ 1569 it('device_info_test_061', 0, function () { 1570 console.info('testGetSecurityPatchTag02 start'); 1571 let ret = false; 1572 let securityPatchTagInfo = deviceinfo.securityPatchTag; 1573 console.info('the value of the deviceinfo securityPatchTag is :' + securityPatchTagInfo); 1574 1575 let reFormat = /^(\d{4})\/(\d{2})\/(\d{2})$/; 1576 let re = securityPatchTagInfo.match(reFormat); 1577 1578 if (re != null) { 1579 ret = true; 1580 expect(ret).assertTrue(); 1581 } else { 1582 console.info('the return formate is not yy--mm--dd'); 1583 } 1584 1585 console.info('testGetSecurityPatchTag02 : end'); 1586 }) 1587 1588 /** 1589 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0662 1590 * @tc.name testGetUdid 1591 * @tc.desc Get udid 1592 */ 1593 it('device_info_test_062', 0, function () { 1594 console.info('device_info_test_062 start'); 1595 let udid = deviceinfo.udid; 1596 console.info('the value of the deviceinfo udid is :' + udid); 1597 1598 let len = udid.length 1599 console.info('the value of the different build host of the same baseline code characters is :' + len); 1600 expect(len).assertLarger(MAX_CHARACTERS_NUM); 1601 console.info('device_info_test_060 : end'); 1602 }) 1603 1604 /** 1605 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0663 1606 * @tc.name testGetUuid 1607 * @tc.desc Get uuid 1608 */ 1609 it('device_info_test_063', 0, function () { 1610 console.info('device_info_test_063 start'); 1611 let ret = false; 1612 let udid = deviceinfo.udid; 1613 console.info('the value of the deviceinfo udid is :' + udid); 1614 1615 expect(udid).assertInstanceOf('String'); 1616 if (udid != "" && udid != null && udid != undefined) { 1617 ret = true; 1618 } 1619 expect(ret).assertTrue(); 1620 console.info('device_info_test_063 : end'); 1621 }) 1622 1623 /** 1624 * @tc.number SUB_STARTUP_JS_DEVCEINFO_0664 1625 * @tc.name testGetUdid 1626 * @tc.desc Get udid 1627 */ 1628 it('device_info_test_064', 0, function () { 1629 console.info('device_info_test_064 start'); 1630 let udid = deviceinfo.udid; 1631 console.info('the value of the deviceinfo udid is :' + udid); 1632 1633 let len = udid.length 1634 console.info('the value of the different build host of the same baseline code characters is :' + len); 1635 expect(len).assertLess(MAX_CHARACTERS_NUM_TWO) 1636 console.info('device_info_test_064 : end'); 1637 }) 1638 }) 1639} 1640