LengthenTest00.js 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. * Copyright (c) 2011-2013 by Andrew Mustun. All rights reserved.
  3. *
  4. * This file is part of the QCAD project.
  5. *
  6. * QCAD is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * QCAD is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with QCAD.
  18. */
  19. // Auto generated by Testing Dashboard
  20. // File : scripts/Modify/Lengthen/Tests/LengthenTest00.js
  21. // Timestamp : 2011-08-05 15:23:08
  22. // Description :
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function LengthenTest00() {
  25. TdbTest.call(this, 'scripts/Modify/Lengthen/Tests/LengthenTest00.js');
  26. }
  27. LengthenTest00.prototype = new TdbTest();
  28. LengthenTest00.prototype.test00 = function() {
  29. qDebug('running LengthenTest00.test00()...');
  30. this.setUp();
  31. this.importFile('scripts/Modify/Lengthen/Tests/data/lines.dxf');
  32. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  33. this.sendMouseEvent(w, QEvent.MouseButtonPress, new QPoint(62, 400), Qt.LeftButton, 1, 0);
  34. var w = objectFromPath('MainWindow::CadToolBar::MainToolsPanel');
  35. this.sendMouseEvent(w, QEvent.MouseButtonRelease, new QPoint(62, 400), Qt.LeftButton, 0, 0);
  36. TdbTest.clickOnWidget('MainWindow::CadToolBar::MainToolsPanel::ModifyToolsPanelButton');
  37. TdbTest.clickOnWidget('MainWindow::CadToolBar::ModifyToolsPanel::LengthenButton');
  38. this.setToolOption('Lengthen/Amount', [ 1, 0 ] );
  39. this.updateToolOptions();
  40. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  41. var p = new RVector(20, 24.642683);
  42. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  43. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  44. this.setToolOption('Lengthen/Amount', [ 2, 0 ] );
  45. this.updateToolOptions();
  46. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  47. var p = new RVector(20, 36.990244);
  48. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  49. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  50. this.setToolOption('Lengthen/Amount', [ 3, 0 ] );
  51. this.updateToolOptions();
  52. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  53. var p = new RVector(13.184146, 19.90122);
  54. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  55. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  56. this.setToolOption('Lengthen/Amount', [ 4, 0 ] );
  57. this.updateToolOptions();
  58. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  59. var p = new RVector(4.886585, 20.09878);
  60. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  61. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  62. this.setToolOption('Lengthen/Amount', [ 5, 0 ] );
  63. this.updateToolOptions();
  64. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  65. var p = new RVector(19.90122, 11.208537);
  66. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  67. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  68. this.setToolOption('Lengthen/Amount', [ 6, 0 ] );
  69. this.updateToolOptions();
  70. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  71. var p = new RVector(20.493902, 7.75122);
  72. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  73. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  74. this.setToolOption('Lengthen/Amount', [ 7, 0 ] );
  75. this.updateToolOptions();
  76. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  77. var p = new RVector(30.371951, 20);
  78. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  79. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  80. this.setToolOption('Lengthen/Amount', [ 8, 0 ] );
  81. this.updateToolOptions();
  82. this.setZoom(10.123456790123457, new RVector(4.99146, 1.2378, 0) );
  83. var p = new RVector(31.162195, 20.09878);
  84. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  85. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  86. var p = new RVector(1.132927, 32.15);
  87. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  88. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  89. this.verifyDrawing('LengthenTest00_000.dxf');
  90. this.tearDown();
  91. qDebug('finished LengthenTest00.test00()');
  92. };