1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package testcase.gui.sc.validity; 25 26 import static testlib.gui.AppUtil.*; 27 import static testlib.gui.UIMap.*; 28 29 import java.io.File; 30 31 import org.junit.After; 32 import static org.junit.Assert.*; 33 import static org.openoffice.test.vcl.Tester.*; 34 35 import org.junit.Before; 36 import org.junit.Rule; 37 import org.junit.Ignore; 38 import org.junit.Test; 39 import org.openoffice.test.vcl.IDList; 40 import org.openoffice.test.vcl.widgets.VclMessageBox; 41 42 import testlib.gui.CalcUtil; 43 import testlib.gui.Log; 44 45 46 public class ValidityDialogSetting { 47 private static IDList idList = new IDList(new File("./ids")); 48 public static final VclMessageBox ActiveMsgBox = new VclMessageBox(idList.getId("UID_ACTIVE"), "Message on message box."); 49 50 @Rule 51 public Log LOG = new Log(); 52 53 @Before 54 public void setUp() throws Exception { 55 app.start(true); 56 57 // New a spreadsheet, select cell range, open Validity dialog 58 app.dispatch("private:factory/scalc"); 59 CalcUtil.selectRange("A1:C5"); 60 app.dispatch(".uno:Validation"); 61 } 62 63 @After 64 public void tearDown() throws Exception { 65 app.close(); 66 } 67 68 /** 69 * test Allow not between Date type in Validity. 70 */ 71 @Test 72 public void testAllowDateNotBetween() { 73 SC_ValidityCriteriaTabpage.select(); 74 SC_ValidityCriteriaAllowList.select(3); // "Date" 75 SC_ValidityDecimalCompareOperator.select(7); // "not between" 76 SC_ValiditySourceInput.setText("01/01/08"); 77 SC_ValidityMaxValueInput.setText("03/01/08"); 78 SC_ValidityErrorAlertTabPage.select(); 79 SC_ValidityShowErrorMessage.check(); 80 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 81 SC_ValidityErrorMessage.setText("Invalid value"); 82 SC_ValidityErrorAlertTabPage.ok(); 83 84 CalcUtil.selectRange("A1"); 85 SC_InputBar_Input.activate(); 86 typeKeys("12/31/07"); 87 typeKeys("<enter>"); 88 assertEquals("12/31/07",CalcUtil.getCellText("A1")); 89 90 CalcUtil.selectRange("A2"); 91 SC_InputBar_Input.activate(); 92 typeKeys("03/02/08"); 93 typeKeys("<enter>"); 94 assertEquals("03/02/08",CalcUtil.getCellText("A2")); 95 96 CalcUtil.selectRange("A3"); 97 SC_InputBar_Input.activate(); 98 typeKeys("01/01/08"); 99 typeKeys("<enter>"); 100 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 101 ActiveMsgBox.ok(); 102 assertEquals("",CalcUtil.getCellText("A3")); 103 104 CalcUtil.selectRange("A4"); 105 SC_InputBar_Input.activate(); 106 typeKeys("03/01/08"); 107 typeKeys("<enter>"); 108 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 109 ActiveMsgBox.ok(); 110 assertEquals("",CalcUtil.getCellText("A4")); 111 112 CalcUtil.selectRange("A5"); 113 SC_InputBar_Input.activate(); 114 typeKeys("01/02/08"); 115 typeKeys("<enter>"); 116 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 117 ActiveMsgBox.ok(); 118 assertEquals("",CalcUtil.getCellText("A5")); 119 120 CalcUtil.selectRange("B1"); 121 SC_InputBar_Input.activate(); 122 typeKeys("02/29/08"); 123 typeKeys("<enter>"); 124 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 125 ActiveMsgBox.ok(); 126 assertEquals("",CalcUtil.getCellText("B1")); 127 128 CalcUtil.selectRange("B2"); 129 SC_InputBar_Input.activate(); 130 typeKeys("test"); 131 typeKeys("<enter>"); 132 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 133 ActiveMsgBox.ok(); 134 assertEquals("",CalcUtil.getCellText("B2")); 135 136 CalcUtil.selectRange("B3"); 137 SC_InputBar_Input.activate(); 138 typeKeys("39448"); 139 typeKeys("<enter>"); 140 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 141 ActiveMsgBox.ok(); 142 assertEquals("",CalcUtil.getCellText("B3")); 143 } 144 145 /** 146 * test Allow Decimal equal in Validity. 147 */ 148 @Test 149 public void testAllowDecimalEqual() { 150 151 SC_ValidityCriteriaTabpage.select(); 152 SC_ValidityCriteriaAllowList.select(2); // "Decimal" 153 SC_ValidityDecimalCompareOperator.select(0); // "equal" 154 SC_ValiditySourceInput.setText("0.33333333"); 155 SC_ValidityErrorAlertTabPage.select(); 156 SC_ValidityShowErrorMessage.check(); 157 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 158 SC_ValidityErrorMessage.setText("Invalid value"); 159 SC_ValidityErrorAlertTabPage.ok(); 160 161 CalcUtil.selectRange("A1"); 162 SC_InputBar_Input.activate(); 163 typeKeys("0.33333333"); 164 typeKeys("<enter>"); 165 assertEquals("0.33333333",CalcUtil.getCellText("A1")); 166 167 CalcUtil.selectRange("A2"); 168 SC_InputBar_Input.activate(); 169 typeKeys("=1/3"); 170 typeKeys("<enter>"); 171 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 172 ActiveMsgBox.ok(); 173 assertEquals("",CalcUtil.getCellText("A2")); 174 175 CalcUtil.selectRange("A3"); 176 SC_InputBar_Input.activate(); 177 typeKeys("0.3"); 178 typeKeys("<enter>"); 179 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 180 ActiveMsgBox.ok(); 181 assertEquals("",CalcUtil.getCellText("A3")); 182 183 CalcUtil.selectRange("A4"); 184 SC_InputBar_Input.activate(); 185 typeKeys("0.333333333"); 186 typeKeys("<enter>"); 187 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 188 ActiveMsgBox.ok(); 189 assertEquals("",CalcUtil.getCellText("A4")); 190 191 CalcUtil.selectRange("B2"); 192 SC_InputBar_Input.activate(); 193 typeKeys("test"); 194 typeKeys("<enter>"); 195 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 196 ActiveMsgBox.ok(); 197 assertEquals("",CalcUtil.getCellText("B2")); 198 } 199 200 /** 201 * test Allow Text length, greater than or equal to in Validity. 202 */ 203 @Test 204 public void testAllowGreaterTextLength() { 205 206 SC_ValidityCriteriaTabpage.select(); 207 SC_ValidityCriteriaAllowList.select(7); // "Text length" 208 SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to" 209 SC_ValiditySourceInput.setText("10"); 210 SC_ValidityErrorAlertTabPage.select(); 211 SC_ValidityShowErrorMessage.check(); 212 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 213 SC_ValidityErrorMessage.setText("Invalid value"); 214 SC_ValidityErrorAlertTabPage.ok(); 215 216 CalcUtil.selectRange("A1"); 217 SC_InputBar_Input.activate(); 218 typeKeys("testtesttesttest"); 219 typeKeys("<enter>"); 220 assertEquals("testtesttesttest",CalcUtil.getCellText("A1")); 221 222 CalcUtil.selectRange("A2"); 223 SC_InputBar_Input.activate(); 224 typeKeys("test test "); 225 typeKeys("<enter>"); 226 assertEquals("test test ",CalcUtil.getCellText("A2")); 227 228 CalcUtil.selectRange("A4"); 229 SC_InputBar_Input.activate(); 230 typeKeys(" "); 231 typeKeys("<enter>"); 232 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 233 ActiveMsgBox.ok(); 234 assertEquals("",CalcUtil.getCellText("A4")); 235 236 CalcUtil.selectRange("A3"); 237 SC_InputBar_Input.activate(); 238 typeKeys("Testatest"); 239 typeKeys("<enter>"); 240 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 241 ActiveMsgBox.ok(); 242 assertEquals("",CalcUtil.getCellText("A3")); 243 } 244 245 /** 246 * test Allow Text length, less than in Validity. 247 */ 248 @Ignore("Bug 93128") 249 public void testAllowLessThanTextLength() { 250 251 app.dispatch(".uno:Validation"); 252 253 SC_ValidityCriteriaTabpage.select(); 254 SC_ValidityCriteriaAllowList.select(7); // "Text length" 255 SC_ValidityDecimalCompareOperator.select(1); // "less than" 256 SC_ValiditySourceInput.setText("10"); 257 258 SC_ValidityInputHelpTabPage.select(); 259 SC_ValidityInputHelpCheckbox.check(); 260 SC_ValidityInputHelpTitle.setText("Help Info Title"); 261 SC_ValidityHelpMessage.setText("help info"); 262 263 SC_ValidityErrorAlertTabPage.select(); 264 SC_ValidityShowErrorMessage.check(); 265 SC_ValidityErrorAlertActionList.select("Information"); 266 SC_ValidityErrorMessageTitle.setText("Notes to enter"); 267 SC_ValidityErrorMessage.setText("Invalid value"); 268 SC_ValidityErrorAlertTabPage.ok(); 269 270 CalcUtil.selectRange("A1"); 271 SC_InputBar_Input.activate(); 272 typeKeys("testtesttesttest<enter>"); 273 ActiveMsgBox.ok(); 274 assertEquals("testtesttesttest",CalcUtil.getCellText("A1")); 275 276 CalcUtil.selectRange("A2"); 277 SC_InputBar_Input.activate(); 278 typeKeys("sfsafsddddddd<enter>"); 279 ActiveMsgBox.cancel(); 280 assertEquals("",CalcUtil.getCellText("A2")); 281 282 CalcUtil.selectRange("A2"); 283 SC_InputBar_Input.activate(); 284 typeKeys("10<enter>"); 285 assertEquals("10",CalcUtil.getCellText("A2")); 286 287 CalcUtil.selectRange("A3"); 288 SC_InputBar_Input.activate(); 289 typeKeys("ok<enter>"); 290 assertEquals("ok",CalcUtil.getCellText("A3")); 291 } 292 293 /** 294 * test Allow list. 295 */ 296 @Test 297 public void testAllowListSpecialChar() { 298 299 SC_ValidityCriteriaTabpage.select(); 300 SC_ValidityCriteriaAllowList.select(6); // "List" 301 SC_ValidityEntries.focus(); 302 typeKeys("a"); 303 typeKeys("<enter>"); 304 typeKeys("b"); 305 SC_ValidityErrorAlertTabPage.select(); 306 SC_ValidityShowErrorMessage.check(); 307 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 308 SC_ValidityErrorMessage.setText("Invalid value"); 309 SC_ValidityCriteriaTabpage.select(); 310 SC_ValidityCriteriaTabpage.ok(); 311 312 // These codes are not stable: start 313 // calc.rightClick(1, 1); 314 // typeKeys("<shift s>"); 315 // typeKeys("<down><enter>"); // Choose a 316 // sleep(2); // if no sleep, error occur 317 // These codes are not stable: end 318 CalcUtil.selectRange("A1"); 319 SC_InputBar_Input.activate(); 320 typeKeys("a<enter>"); 321 assertEquals("a",CalcUtil.getCellText("A1")); 322 323 CalcUtil.selectRange("B2"); 324 SC_InputBar_Input.activate(); 325 typeKeys("test"); 326 typeKeys("<enter>"); 327 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 328 ActiveMsgBox.ok(); 329 assertEquals("",CalcUtil.getCellText("B2")); 330 } 331 332 /** 333 * test Allow time between in Validity. 334 */ 335 @Test 336 public void testAllowTimeBetween() { 337 338 SC_ValidityCriteriaTabpage.select(); 339 SC_ValidityCriteriaAllowList.select(4); // "Time" 340 SC_ValidityDecimalCompareOperator.select(6); // "between" 341 SC_ValiditySourceInput.setText("27:00"); 342 SC_ValidityMaxValueInput.setText("21:00"); 343 SC_ValidityErrorAlertTabPage.select(); 344 SC_ValidityShowErrorMessage.check(); 345 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 346 SC_ValidityErrorMessage.setText("Invalid value"); 347 SC_ValidityErrorAlertTabPage.ok(); 348 349 CalcUtil.selectRange("A1"); 350 SC_InputBar_Input.activate(); 351 typeKeys("21:00"); 352 typeKeys("<enter>"); 353 assertEquals("09:00:00 PM",CalcUtil.getCellText("A1")); 354 355 CalcUtil.selectRange("A2"); 356 SC_InputBar_Input.activate(); 357 typeKeys("27:00"); 358 typeKeys("<enter>"); 359 assertEquals("27:00:00",CalcUtil.getCellText("A2")); 360 361 CalcUtil.selectRange("A3"); 362 SC_InputBar_Input.activate(); 363 typeKeys("1.125"); 364 typeKeys("<enter>"); 365 assertEquals("1.125",CalcUtil.getCellText("A3")); 366 367 CalcUtil.selectRange("A4"); 368 SC_InputBar_Input.activate(); 369 typeKeys("0.875"); 370 typeKeys("<enter>"); 371 assertEquals("0.875",CalcUtil.getCellText("A4")); 372 373 CalcUtil.selectRange("B1"); 374 SC_InputBar_Input.activate(); 375 typeKeys("03:00:01"); 376 typeKeys("<enter>"); 377 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 378 ActiveMsgBox.ok(); 379 assertEquals("",CalcUtil.getCellText("B1")); 380 381 CalcUtil.selectRange("B2"); 382 SC_InputBar_Input.activate(); 383 typeKeys("20:59:59"); 384 typeKeys("<enter>"); 385 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 386 ActiveMsgBox.ok(); 387 assertEquals("",CalcUtil.getCellText("B2")); 388 389 CalcUtil.selectRange("B3"); 390 SC_InputBar_Input.activate(); 391 typeKeys("1.126"); 392 typeKeys("<enter>"); 393 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 394 ActiveMsgBox.ok(); 395 assertEquals("",CalcUtil.getCellText("B3")); 396 397 CalcUtil.selectRange("B4"); 398 SC_InputBar_Input.activate(); 399 typeKeys("0.874"); 400 typeKeys("<enter>"); 401 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 402 ActiveMsgBox.ok(); 403 assertEquals("",CalcUtil.getCellText("B4")); 404 405 CalcUtil.selectRange("C1"); 406 SC_InputBar_Input.activate(); 407 typeKeys("test"); 408 typeKeys("<enter>"); 409 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 410 ActiveMsgBox.ok(); 411 assertEquals("",CalcUtil.getCellText("C1")); 412 413 CalcUtil.selectRange("C2"); 414 SC_InputBar_Input.activate(); 415 typeKeys("24:00"); 416 typeKeys("<enter>"); 417 assertEquals("24:00:00",CalcUtil.getCellText("C2")); 418 419 CalcUtil.selectRange("C3"); 420 SC_InputBar_Input.activate(); 421 typeKeys("12:00"); 422 typeKeys("<enter>"); 423 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 424 ActiveMsgBox.ok(); 425 assertEquals("",CalcUtil.getCellText("C3")); 426 } 427 428 /** 429 * test Allow time Greater than and equal to in Validity. 430 */ 431 @Test 432 public void testAllowTimeGreaterThan() { 433 434 SC_ValidityCriteriaTabpage.select(); 435 SC_ValidityCriteriaAllowList.select(4); // "Time" 436 SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to" 437 SC_ValiditySourceInput.setText("8:00"); 438 439 SC_ValidityErrorAlertTabPage.select(); 440 SC_ValidityShowErrorMessage.check(); 441 SC_ValidityErrorAlertActionList.select(1); // "Warning" 442 443 SC_ValidityErrorMessageTitle.setText("warning to enter"); 444 SC_ValidityErrorMessage.setText("Invalid value"); 445 SC_ValidityErrorAlertTabPage.ok(); 446 447 CalcUtil.selectRange("A1"); 448 SC_InputBar_Input.activate(); 449 typeKeys("7:30"); 450 typeKeys("<enter>"); 451 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 452 ActiveMsgBox.ok(); 453 assertEquals("07:30:00 AM",CalcUtil.getCellText("A1")); 454 455 CalcUtil.selectRange("A2"); 456 SC_InputBar_Input.activate(); 457 typeKeys("6:00"); 458 typeKeys("<enter>"); 459 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 460 ActiveMsgBox.cancel(); 461 assertEquals("",CalcUtil.getCellText("A2")); 462 463 CalcUtil.selectRange("A3"); 464 SC_InputBar_Input.activate(); 465 typeKeys("8:00"); 466 typeKeys("<enter>"); 467 assertEquals("08:00:00 AM",CalcUtil.getCellText("A3")); 468 } 469 470 /** 471 * test Allow whole number, less than or equal to in Validity. 472 */ 473 @Test 474 public void testAllowWholeNumLessThan() { 475 476 SC_ValidityCriteriaTabpage.select(); 477 SC_ValidityCriteriaAllowList.select(1); // "Whole Numbers" 478 SC_ValidityDecimalCompareOperator.select(3); // "less than or equal" 479 SC_ValiditySourceInput.setText("100"); 480 SC_ValidityErrorAlertTabPage.select(); 481 SC_ValidityShowErrorMessage.check(); 482 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 483 SC_ValidityErrorMessage.setText("Invalid value"); 484 SC_ValidityErrorAlertTabPage.ok(); 485 486 CalcUtil.selectRange("A1"); 487 SC_InputBar_Input.activate(); 488 typeKeys("99"); 489 typeKeys("<enter>"); 490 assertEquals("99",CalcUtil.getCellText("A1")); 491 492 CalcUtil.selectRange("A2"); 493 SC_InputBar_Input.activate(); 494 typeKeys("100"); 495 typeKeys("<enter>"); 496 assertEquals("100",CalcUtil.getCellText("A2")); 497 498 CalcUtil.selectRange("B1"); 499 SC_InputBar_Input.activate(); 500 typeKeys("101"); 501 typeKeys("<enter>"); 502 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 503 ActiveMsgBox.ok(); 504 assertEquals("",CalcUtil.getCellText("B1")); 505 506 CalcUtil.selectRange("B2"); 507 SC_InputBar_Input.activate(); 508 typeKeys("45.5"); 509 typeKeys("<enter>"); 510 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 511 ActiveMsgBox.ok(); 512 assertEquals("",CalcUtil.getCellText("B2")); 513 514 CalcUtil.selectRange("C1"); 515 SC_InputBar_Input.activate(); 516 typeKeys("test"); 517 typeKeys("<enter>"); 518 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 519 ActiveMsgBox.ok(); 520 assertEquals("",CalcUtil.getCellText("C1")); 521 } 522 523 /** 524 * test default message of Error Alert in Validity. 525 */ 526 @Test 527 public void testDefaultErrorAlertMessage() { 528 529 SC_ValidityCriteriaTabpage.select(); 530 SC_ValidityCriteriaAllowList.select(2); // "Decimal" 531 SC_ValidityDecimalCompareOperator.select(0); // "equal" 532 SC_ValiditySourceInput.setText("1"); 533 534 SC_ValidityErrorAlertTabPage.select(); 535 SC_ValidityShowErrorMessage.check(); 536 SC_ValidityErrorAlertActionList.select(0); // "Stop" 537 SC_ValidityErrorAlertTabPage.ok(); 538 539 CalcUtil.selectRange("A1"); 540 SC_InputBar_Input.activate(); 541 typeKeys("13"); 542 typeKeys("<enter>"); 543 assertEquals("OpenOffice.org Calc",ActiveMsgBox.getCaption()); 544 // assertEquals("Invalid value.",ActiveMsgBox.getMessage()); // Can not verify in multi-language 545 ActiveMsgBox.ok(); 546 assertEquals("",CalcUtil.getCellText("A1")); 547 } 548 549 /** 550 * test uncheck Error Alert in Validity. 551 */ 552 @Test 553 public void testUncheckErrorAlert() { 554 555 SC_ValidityCriteriaTabpage.select(); 556 SC_ValidityCriteriaAllowList.select(2); // "Decimal" 557 SC_ValidityDecimalCompareOperator.select(0); // "equal" 558 SC_ValiditySourceInput.setText("1"); 559 560 SC_ValidityErrorAlertTabPage.select(); 561 SC_ValidityShowErrorMessage.uncheck(); 562 SC_ValidityErrorAlertActionList.select(0); // "Stop" 563 SC_ValidityErrorAlertTabPage.ok(); 564 565 CalcUtil.selectRange("A1"); 566 typeKeys("13"); 567 typeKeys("<enter>"); 568 assertEquals("13",CalcUtil.getCellText("A1")); 569 } 570 571 /** 572 * test Cell range source picker in Validity. Input from Edit Box. 573 */ 574 @Test 575 public void testValidityCellRangeSourcePicker() { 576 577 SC_ValidityCriteriaTabpage.select(); 578 SC_ValidityCriteriaAllowList.select(5); // "Cell range" 579 SC_ValiditySourcePicker.click(); 580 assertEquals(false,SC_ValidityCriteriaAllowList.exists()); 581 SC_ValiditySourceInput.setText("$E$2:$G$5"); 582 SC_ValiditySourcePicker.click(); 583 assertEquals(true,SC_ValidityCriteriaAllowList.exists()); 584 585 SC_ValidityErrorAlertTabPage.select(); 586 SC_ValidityShowErrorMessage.check(); 587 SC_ValidityErrorAlertActionList.select(0); // "Stop" 588 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 589 SC_ValidityErrorMessage.setText("Invalid value."); 590 SC_ValidityErrorAlertTabPage.ok(); 591 592 // calc.focus(); 593 CalcUtil.selectRange("E2"); 594 SC_InputBar_Input.activate(); 595 typeKeys("test"); 596 typeKeys("<enter>"); 597 598 CalcUtil.selectRange("A1"); 599 SC_InputBar_Input.activate(); 600 typeKeys("test32"); 601 typeKeys("<enter>"); 602 assertEquals("Invalid value.",ActiveMsgBox.getMessage()); 603 ActiveMsgBox.ok(); 604 assertEquals("",CalcUtil.getCellText("A1")); 605 606 CalcUtil.selectRange("B1"); 607 SC_InputBar_Input.activate(); 608 typeKeys("test"); 609 typeKeys("<enter>"); 610 assertEquals("test",CalcUtil.getCellText("B1")); 611 } 612 613 /** 614 * test Allow Blank cell Checkbox in Validity. 615 */ 616 @Test 617 public void testAllowBlankCells() { 618 SC_ValidityCriteriaTabpage.select(); 619 SC_ValidityCriteriaAllowList.select(5); // "Cell range" 620 SC_ValiditySourceInput.setText("$E$1:$E$5"); 621 SC_ValidityAllowBlankCells.check(); 622 SC_ValidityCriteriaTabpage.ok(); 623 624 CalcUtil.selectRange("E1"); 625 typeKeys("A<enter>A<enter>A<enter>A<enter>A<enter>"); 626 627 CalcUtil.selectRange("A1"); 628 typeKeys("A<enter>"); 629 CalcUtil.selectRange("D1"); 630 SC_InputBar_Input.activate(); 631 typeKeys("<backspace><enter>"); 632 assertEquals("",CalcUtil.getCellText("D1")); 633 634 CalcUtil.selectRange("B1"); 635 app.dispatch(".uno:Validation"); 636 SC_ValidityCriteriaTabpage.select(); 637 SC_ValidityAllowBlankCells.uncheck(); 638 typeKeys("<enter>"); 639 640 CalcUtil.selectRange("B1"); 641 SC_InputBar_Input.activate(); 642 typeKeys("<backspace><enter>"); 643 typeKeys("<enter>"); 644 } 645 } 646 647