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(); 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 calc.rightClick(1, 1); 313 typeKeys("<shift s>"); 314 typeKeys("<down><enter>"); // Choose a 315 sleep(2); // if no sleep, error occur 316 assertEquals("a",CalcUtil.getCellText("A1")); 317 318 CalcUtil.selectRange("B2"); 319 SC_InputBar_Input.activate(); 320 typeKeys("test"); 321 typeKeys("<enter>"); 322 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 323 ActiveMsgBox.ok(); 324 assertEquals("",CalcUtil.getCellText("B2")); 325 } 326 327 /** 328 * test Allow time between in Validity. 329 */ 330 @Test 331 public void testAllowTimeBetween() { 332 333 SC_ValidityCriteriaTabpage.select(); 334 SC_ValidityCriteriaAllowList.select(4); // "Time" 335 SC_ValidityDecimalCompareOperator.select(6); // "between" 336 SC_ValiditySourceInput.setText("27:00"); 337 SC_ValidityMaxValueInput.setText("21:00"); 338 SC_ValidityErrorAlertTabPage.select(); 339 SC_ValidityShowErrorMessage.check(); 340 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 341 SC_ValidityErrorMessage.setText("Invalid value"); 342 SC_ValidityErrorAlertTabPage.ok(); 343 344 CalcUtil.selectRange("A1"); 345 SC_InputBar_Input.activate(); 346 typeKeys("21:00"); 347 typeKeys("<enter>"); 348 assertEquals("09:00:00 PM",CalcUtil.getCellText("A1")); 349 350 CalcUtil.selectRange("A2"); 351 SC_InputBar_Input.activate(); 352 typeKeys("27:00"); 353 typeKeys("<enter>"); 354 assertEquals("27:00:00",CalcUtil.getCellText("A2")); 355 356 CalcUtil.selectRange("A3"); 357 SC_InputBar_Input.activate(); 358 typeKeys("1.125"); 359 typeKeys("<enter>"); 360 assertEquals("1.125",CalcUtil.getCellText("A3")); 361 362 CalcUtil.selectRange("A4"); 363 SC_InputBar_Input.activate(); 364 typeKeys("0.875"); 365 typeKeys("<enter>"); 366 assertEquals("0.875",CalcUtil.getCellText("A4")); 367 368 CalcUtil.selectRange("B1"); 369 SC_InputBar_Input.activate(); 370 typeKeys("03:00:01"); 371 typeKeys("<enter>"); 372 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 373 ActiveMsgBox.ok(); 374 assertEquals("",CalcUtil.getCellText("B1")); 375 376 CalcUtil.selectRange("B2"); 377 SC_InputBar_Input.activate(); 378 typeKeys("20:59:59"); 379 typeKeys("<enter>"); 380 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 381 ActiveMsgBox.ok(); 382 assertEquals("",CalcUtil.getCellText("B2")); 383 384 CalcUtil.selectRange("B3"); 385 SC_InputBar_Input.activate(); 386 typeKeys("1.126"); 387 typeKeys("<enter>"); 388 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 389 ActiveMsgBox.ok(); 390 assertEquals("",CalcUtil.getCellText("B3")); 391 392 CalcUtil.selectRange("B4"); 393 SC_InputBar_Input.activate(); 394 typeKeys("0.874"); 395 typeKeys("<enter>"); 396 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 397 ActiveMsgBox.ok(); 398 assertEquals("",CalcUtil.getCellText("B4")); 399 400 CalcUtil.selectRange("C1"); 401 SC_InputBar_Input.activate(); 402 typeKeys("test"); 403 typeKeys("<enter>"); 404 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 405 ActiveMsgBox.ok(); 406 assertEquals("",CalcUtil.getCellText("C1")); 407 408 CalcUtil.selectRange("C2"); 409 SC_InputBar_Input.activate(); 410 typeKeys("24:00"); 411 typeKeys("<enter>"); 412 assertEquals("24:00:00",CalcUtil.getCellText("C2")); 413 414 CalcUtil.selectRange("C3"); 415 SC_InputBar_Input.activate(); 416 typeKeys("12:00"); 417 typeKeys("<enter>"); 418 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 419 ActiveMsgBox.ok(); 420 assertEquals("",CalcUtil.getCellText("C3")); 421 } 422 423 /** 424 * test Allow time Greater than and equal to in Validity. 425 */ 426 @Test 427 public void testAllowTimeGreaterThan() { 428 429 SC_ValidityCriteriaTabpage.select(); 430 SC_ValidityCriteriaAllowList.select(4); // "Time" 431 SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to" 432 SC_ValiditySourceInput.setText("8:00"); 433 434 SC_ValidityErrorAlertTabPage.select(); 435 SC_ValidityShowErrorMessage.check(); 436 SC_ValidityErrorAlertActionList.select(1); // "Warning" 437 438 SC_ValidityErrorMessageTitle.setText("warning to enter"); 439 SC_ValidityErrorMessage.setText("Invalid value"); 440 SC_ValidityErrorAlertTabPage.ok(); 441 442 CalcUtil.selectRange("A1"); 443 SC_InputBar_Input.activate(); 444 typeKeys("7:30"); 445 typeKeys("<enter>"); 446 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 447 ActiveMsgBox.ok(); 448 assertEquals("07:30:00 AM",CalcUtil.getCellText("A1")); 449 450 CalcUtil.selectRange("A2"); 451 SC_InputBar_Input.activate(); 452 typeKeys("6:00"); 453 typeKeys("<enter>"); 454 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 455 ActiveMsgBox.cancel(); 456 assertEquals("",CalcUtil.getCellText("A2")); 457 458 CalcUtil.selectRange("A3"); 459 SC_InputBar_Input.activate(); 460 typeKeys("8:00"); 461 typeKeys("<enter>"); 462 assertEquals("08:00:00 AM",CalcUtil.getCellText("A3")); 463 } 464 465 /** 466 * test Allow whole number, less than or equal to in Validity. 467 */ 468 @Test 469 public void testAllowWholeNumLessThan() { 470 471 SC_ValidityCriteriaTabpage.select(); 472 SC_ValidityCriteriaAllowList.select(1); // "Whole Numbers" 473 SC_ValidityDecimalCompareOperator.select(3); // "less than or equal" 474 SC_ValiditySourceInput.setText("100"); 475 SC_ValidityErrorAlertTabPage.select(); 476 SC_ValidityShowErrorMessage.check(); 477 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 478 SC_ValidityErrorMessage.setText("Invalid value"); 479 SC_ValidityErrorAlertTabPage.ok(); 480 481 CalcUtil.selectRange("A1"); 482 SC_InputBar_Input.activate(); 483 typeKeys("99"); 484 typeKeys("<enter>"); 485 assertEquals("99",CalcUtil.getCellText("A1")); 486 487 CalcUtil.selectRange("A2"); 488 SC_InputBar_Input.activate(); 489 typeKeys("100"); 490 typeKeys("<enter>"); 491 assertEquals("100",CalcUtil.getCellText("A2")); 492 493 CalcUtil.selectRange("B1"); 494 SC_InputBar_Input.activate(); 495 typeKeys("101"); 496 typeKeys("<enter>"); 497 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 498 ActiveMsgBox.ok(); 499 assertEquals("",CalcUtil.getCellText("B1")); 500 501 CalcUtil.selectRange("B2"); 502 SC_InputBar_Input.activate(); 503 typeKeys("45.5"); 504 typeKeys("<enter>"); 505 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 506 ActiveMsgBox.ok(); 507 assertEquals("",CalcUtil.getCellText("B2")); 508 509 CalcUtil.selectRange("C1"); 510 SC_InputBar_Input.activate(); 511 typeKeys("test"); 512 typeKeys("<enter>"); 513 assertEquals("Invalid value",ActiveMsgBox.getMessage()); 514 ActiveMsgBox.ok(); 515 assertEquals("",CalcUtil.getCellText("C1")); 516 } 517 518 /** 519 * test default message of Error Alert in Validity. 520 */ 521 @Test 522 public void testDefaultErrorAlertMessage() { 523 524 SC_ValidityCriteriaTabpage.select(); 525 SC_ValidityCriteriaAllowList.select(2); // "Decimal" 526 SC_ValidityDecimalCompareOperator.select(0); // "equal" 527 SC_ValiditySourceInput.setText("1"); 528 529 SC_ValidityErrorAlertTabPage.select(); 530 SC_ValidityShowErrorMessage.check(); 531 SC_ValidityErrorAlertActionList.select(0); // "Stop" 532 SC_ValidityErrorAlertTabPage.ok(); 533 534 CalcUtil.selectRange("A1"); 535 SC_InputBar_Input.activate(); 536 typeKeys("13"); 537 typeKeys("<enter>"); 538 assertEquals("OpenOffice.org Calc",ActiveMsgBox.getCaption()); 539 // assertEquals("Invalid value.",ActiveMsgBox.getMessage()); // Can not verify in multi-language 540 ActiveMsgBox.ok(); 541 assertEquals("",CalcUtil.getCellText("A1")); 542 } 543 544 /** 545 * test uncheck Error Alert in Validity. 546 */ 547 @Test 548 public void testUncheckErrorAlert() { 549 550 SC_ValidityCriteriaTabpage.select(); 551 SC_ValidityCriteriaAllowList.select(2); // "Decimal" 552 SC_ValidityDecimalCompareOperator.select(0); // "equal" 553 SC_ValiditySourceInput.setText("1"); 554 555 SC_ValidityErrorAlertTabPage.select(); 556 SC_ValidityShowErrorMessage.uncheck(); 557 SC_ValidityErrorAlertActionList.select(0); // "Stop" 558 SC_ValidityErrorAlertTabPage.ok(); 559 560 CalcUtil.selectRange("A1"); 561 typeKeys("13"); 562 typeKeys("<enter>"); 563 assertEquals("13",CalcUtil.getCellText("A1")); 564 } 565 566 /** 567 * test Cell range source picker in Validity. Input from Edit Box. 568 */ 569 @Test 570 public void testValidityCellRangeSourcePicker() { 571 572 SC_ValidityCriteriaTabpage.select(); 573 SC_ValidityCriteriaAllowList.select(5); // "Cell range" 574 SC_ValiditySourcePicker.click(); 575 assertEquals(false,SC_ValidityCriteriaAllowList.exists()); 576 SC_ValiditySourceInput.setText("$E$2:$G$5"); 577 SC_ValiditySourcePicker.click(); 578 assertEquals(true,SC_ValidityCriteriaAllowList.exists()); 579 580 SC_ValidityErrorAlertTabPage.select(); 581 SC_ValidityShowErrorMessage.check(); 582 SC_ValidityErrorAlertActionList.select(0); // "Stop" 583 SC_ValidityErrorMessageTitle.setText("Stop to enter"); 584 SC_ValidityErrorMessage.setText("Invalid value."); 585 SC_ValidityErrorAlertTabPage.ok(); 586 587 // calc.focus(); 588 CalcUtil.selectRange("E2"); 589 SC_InputBar_Input.activate(); 590 typeKeys("test"); 591 typeKeys("<enter>"); 592 593 CalcUtil.selectRange("A1"); 594 SC_InputBar_Input.activate(); 595 typeKeys("test32"); 596 typeKeys("<enter>"); 597 assertEquals("Invalid value.",ActiveMsgBox.getMessage()); 598 ActiveMsgBox.ok(); 599 assertEquals("",CalcUtil.getCellText("A1")); 600 601 CalcUtil.selectRange("B1"); 602 SC_InputBar_Input.activate(); 603 typeKeys("test"); 604 typeKeys("<enter>"); 605 assertEquals("test",CalcUtil.getCellText("B1")); 606 } 607 608 /** 609 * test Allow Blank cell Checkbox in Validity. 610 */ 611 @Test 612 public void testAllowBlankCells() { 613 SC_ValidityCriteriaTabpage.select(); 614 SC_ValidityCriteriaAllowList.select(5); // "Cell range" 615 SC_ValiditySourceInput.setText("$E$1:$E$5"); 616 SC_ValidityAllowBlankCells.check(); 617 SC_ValidityCriteriaTabpage.ok(); 618 619 CalcUtil.selectRange("E1"); 620 typeKeys("A<enter>A<enter>A<enter>A<enter>A<enter>"); 621 622 CalcUtil.selectRange("A1"); 623 typeKeys("A<enter>"); 624 CalcUtil.selectRange("D1"); 625 SC_InputBar_Input.activate(); 626 typeKeys("<backspace><enter>"); 627 assertEquals("",CalcUtil.getCellText("D1")); 628 629 CalcUtil.selectRange("B1"); 630 app.dispatch(".uno:Validation"); 631 SC_ValidityCriteriaTabpage.select(); 632 SC_ValidityAllowBlankCells.uncheck(); 633 typeKeys("<enter>"); 634 635 CalcUtil.selectRange("B1"); 636 SC_InputBar_Input.activate(); 637 typeKeys("<backspace><enter>"); 638 typeKeys("<enter>"); 639 } 640 } 641 642