Arc2PRTest00.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/Draw/Arc/Arc2PR/Tests/Arc2PRTest00.js
  21. // Timestamp : 2011-03-01 10:09:09
  22. // Description : 4 arcs using all combinations of clockwise, counter clockwise, solution1 and solution2
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function Arc2PRTest00() {
  25. TdbTest.call(this, 'scripts/Draw/Arc/Arc2PR/Tests/Arc2PRTest00.js');
  26. }
  27. Arc2PRTest00.prototype = new TdbTest();
  28. Arc2PRTest00.prototype.test00 = function() {
  29. qDebug('running Arc2PRTest00.test00()...');
  30. this.setUp();
  31. this.clickOnWidget('MainWindow::MainToolsPanel::ArcToolsPanelButton');
  32. this.clickOnWidget('MainWindow::ArcToolsPanel::Arc2PRButton');
  33. this.setToolOption('Arc2PR/Radius', [ 10, 0 ] );
  34. this.setToolOption('Arc2PR/Direction', 'CounterClockwise');
  35. this.setToolOption('Arc2PR/Solution', 'Solution1');
  36. this.updateToolOptions();
  37. this.setZoom(10, new RVector(5, 5, 0) );
  38. var p = new RVector(10, 19.9);
  39. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  40. var p = new RVector(10, 19.9);
  41. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  42. this.setZoom(10, new RVector(5, 5, 0) );
  43. var p = new RVector(20, 20);
  44. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  45. var p = new RVector(20, 20);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  47. this.setToolOption('Arc2PR/Radius', [ 10, 0 ] );
  48. this.setToolOption('Arc2PR/Direction', 'Clockwise');
  49. this.setToolOption('Arc2PR/Solution', 'Solution1');
  50. this.updateToolOptions();
  51. this.setZoom(10, new RVector(5, 5, 0) );
  52. var p = new RVector(9.9, 20.1);
  53. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  54. var p = new RVector(9.9, 20.1);
  55. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  56. this.setZoom(10, new RVector(5, 5, 0) );
  57. var p = new RVector(20.1, 20);
  58. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  59. var p = new RVector(20.1, 20);
  60. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  61. this.setToolOption('Arc2PR/Radius', [ 10, 0 ] );
  62. this.setToolOption('Arc2PR/Direction', 'CounterClockwise');
  63. this.setToolOption('Arc2PR/Solution', 'Solution2');
  64. this.updateToolOptions();
  65. this.setZoom(10, new RVector(5, 5, 0) );
  66. var p = new RVector(9.9, 20);
  67. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  68. var p = new RVector(9.9, 20);
  69. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  70. this.setZoom(10, new RVector(5, 5, 0) );
  71. var p = new RVector(19.8, 19.9);
  72. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  73. var p = new RVector(19.8, 19.9);
  74. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  75. this.setToolOption('Arc2PR/Radius', [ 10, 0 ] );
  76. this.setToolOption('Arc2PR/Direction', 'Clockwise');
  77. this.setToolOption('Arc2PR/Solution', 'Solution2');
  78. this.updateToolOptions();
  79. this.setZoom(10, new RVector(5, 5, 0) );
  80. var p = new RVector(10, 20.1);
  81. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  82. var p = new RVector(10, 20.1);
  83. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  84. this.setZoom(10, new RVector(5, 5, 0) );
  85. var p = new RVector(20, 19.9);
  86. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  87. var p = new RVector(20, 19.9);
  88. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  89. var p = new RVector(25.1, 17.4);
  90. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  91. var p = new RVector(25.1, 17.4);
  92. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  93. this.verifyDrawing('Arc2PRTest00_000.dxf');
  94. this.tearDown();
  95. qDebug('finished Arc2PRTest00.test00()');
  96. };