InsertBlockTest01.js 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Auto generated by Testing Dashboard
  2. // File : scripts/Block/InsertBlock/Tests/InsertBlockTest01.js
  3. // Timestamp : 2015-04-16 09:02:39
  4. // Description :
  5. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  6. function InsertBlockTest01() {
  7. TdbTest.call(this, 'scripts/Block/InsertBlock/Tests/InsertBlockTest01.js');
  8. }
  9. InsertBlockTest01.prototype = new TdbTest();
  10. InsertBlockTest01.prototype.test00 = function() {
  11. qDebug('running InsertBlockTest01.test00()...');
  12. this.setUp();
  13. TdbTest.clickOnWidget('MainWindow::CadToolBar::MainToolsPanel::LineToolsPanelButton');
  14. TdbTest.clickOnWidget('MainWindow::CadToolBar::LineToolsPanel::Line2PButton');
  15. this.setZoom(10, new RVector(5, 5, 0, true));
  16. var p = new RVector(9.9, 10);
  17. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  18. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  19. this.setZoom(10, new RVector(5, 5, 0, true));
  20. var p = new RVector(16.1, 16.1);
  21. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  22. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  23. this.setZoom(10, new RVector(5, 5, 0, true));
  24. var p = new RVector(19.9, 10);
  25. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  26. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  27. this.setZoom(10, new RVector(5, 5, 0, true));
  28. var p = new RVector(10.6, 9.8);
  29. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  30. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  31. var p = new RVector(27.7, 15.2);
  32. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  33. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  34. var p = new RVector(24.9, 19.3);
  35. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  36. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  37. var p = new RVector(14.3, 19.5);
  38. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  40. TdbTest.clickOnWidget('MainWindow::CadToolBar::MainToolsPanel::SelectToolsPanelButton');
  41. TdbTest.clickOnWidget('MainWindow::CadToolBar::SelectToolsPanel::SelectAllButton');
  42. TdbTest.clickOnWidget('MainWindow::CadToolBar::SelectToolsPanel::BackButton');
  43. TdbTest.clickOnWidget('MainWindow::CadToolBar::MainToolsPanel::CreateBlockButton');
  44. this.setZoom(10, new RVector(5, 5, 0, true));
  45. var p = new RVector(9.4, 10);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  47. this.dlgStart();
  48. this.dlgAppendCode('var map = new Map()');
  49. this.dlgAppendCode("map.put('DialogOpenedByTdb/BlockName', 'block 1')");
  50. this.dlgAppendCode("WidgetFactory.restoreState(dialog, 'DialogOpenedByTdb', undefined, false, undefined, map)");
  51. this.dlgEnd();
  52. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  53. var w = objectFromPath('MainWindow::BlockListDock::BlockListWidget::BlockList::qt_scrollarea_viewport');
  54. this.sendMouseEvent(w, QEvent.MouseButtonPress, new QPoint(87, 51), Qt.LeftButton, 1, 0);
  55. var w = objectFromPath('MainWindow::BlockListDock::BlockListWidget::BlockList::qt_scrollarea_viewport');
  56. this.sendMouseEvent(w, QEvent.MouseButtonRelease, new QPoint(87, 51), Qt.LeftButton, 0, 0);
  57. this.dlgStart();
  58. this.dlgAppendCode('var map = new Map()');
  59. this.dlgAppendCode("map.put('DialogOpenedByTdb/ColumnCount', '5')");
  60. this.dlgAppendCode("map.put('DialogOpenedByTdb/RowCount', '3')");
  61. this.dlgAppendCode("map.put('DialogOpenedByTdb/ColumnSpacing', '20')");
  62. this.dlgAppendCode("map.put('DialogOpenedByTdb/RowSpacing', '10')");
  63. this.dlgAppendCode("WidgetFactory.restoreState(dialog, 'DialogOpenedByTdb', undefined, false, undefined, map)");
  64. this.dlgEnd();
  65. TdbTest.clickOnWidget('MainWindow::BlockListDock::BlockListWidget::InsertBlock');
  66. this.setToolOption('InsertBlock/Rotation', '0');
  67. this.updateToolOptions();
  68. TdbTest.clickOnWidget('MainWindow::Options::Array');
  69. this.setZoom(10, new RVector(5, 5, 0, true));
  70. var p = new RVector(30.1, 9.9);
  71. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  72. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  73. var p = new RVector(24.3, 15.7);
  74. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  75. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  76. this.verifyDrawing('InsertBlockTest01_000.dxf');
  77. this.tearDown();
  78. qDebug('finished InsertBlockTest01.test00()');
  79. };