LineVerticalTest00.js 4.6 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/Draw/Line/LineVertical/Tests/LineVerticalTest00.js
  21. // Timestamp : 2011-02-28 13:35:55
  22. // Description : 6 lines, length of 10 / 20, different reference points
  23. include('scripts/Pro/Developer/TestingDashboard/TdbTest.js');
  24. function LineVerticalTest00() {
  25. TdbTest.call(this, 'scripts/Draw/Line/LineVertical/Tests/LineVerticalTest00.js');
  26. }
  27. LineVerticalTest00.prototype = new TdbTest();
  28. LineVerticalTest00.prototype.test00 = function() {
  29. qDebug('running LineVerticalTest00.test00()...');
  30. this.setUp();
  31. this.clickOnWidget('MainWindow::MainToolsPanel::LineToolsPanelButton');
  32. this.clickOnWidget('MainWindow::LineToolsPanel::LineVerticalButton');
  33. this.setToolOption('LineHorizontal/Length', [ 10, 0 ] );
  34. this.setToolOption('LineHorizontal/ReferencePoint', 'Start');
  35. this.updateToolOptions();
  36. this.setZoom(10, new RVector(5, 5, 0) );
  37. var p = new RVector(0, 9.8);
  38. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  39. var p = new RVector(0, 9.8);
  40. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  41. this.setToolOption('LineHorizontal/Length', [ 10, 0 ] );
  42. this.setToolOption('LineHorizontal/ReferencePoint', 'Middle');
  43. this.updateToolOptions();
  44. this.setZoom(10, new RVector(5, 5, 0) );
  45. var p = new RVector(10.1, 9.9);
  46. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  47. var p = new RVector(10.1, 9.9);
  48. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  49. this.setToolOption('LineHorizontal/Length', [ 10, 0 ] );
  50. this.setToolOption('LineHorizontal/ReferencePoint', 'End');
  51. this.updateToolOptions();
  52. this.setZoom(10, new RVector(5, 5, 0) );
  53. var p = new RVector(19.9, 10);
  54. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  55. var p = new RVector(19.9, 10);
  56. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  57. this.setToolOption('LineHorizontal/Length', [ 20, 0 ] );
  58. this.setToolOption('LineHorizontal/ReferencePoint', 'Start');
  59. this.updateToolOptions();
  60. this.setZoom(10, new RVector(5, 5, 0) );
  61. var p = new RVector(29.8, 9.9);
  62. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  63. var p = new RVector(29.8, 9.9);
  64. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  65. this.setToolOption('LineHorizontal/Length', [ 20, 0 ] );
  66. this.setToolOption('LineHorizontal/ReferencePoint', 'Middle');
  67. this.updateToolOptions();
  68. this.setZoom(10, new RVector(5, 5, 0) );
  69. var p = new RVector(39.9, 10.1);
  70. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  71. var p = new RVector(39.9, 10.1);
  72. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  73. var p = new RVector(41.9, 11.7);
  74. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.MidButton, 4, 0);
  75. var p = new RVector(41.9, 11.7);
  76. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.MidButton, 0, 0);
  77. this.setToolOption('LineHorizontal/Length', [ 20, 0 ] );
  78. this.setToolOption('LineHorizontal/ReferencePoint', 'End');
  79. this.updateToolOptions();
  80. this.setZoom(10, new RVector(-2.6, 4.6, 0) );
  81. var p = new RVector(50, 10);
  82. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.LeftButton, 1, 0);
  83. var p = new RVector(50, 10);
  84. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.LeftButton, 0, 0);
  85. var p = new RVector(29.9, 10.8);
  86. this.sendMouseEventModelPos(QEvent.MouseButtonRelease, p, Qt.RightButton, 0, 0);
  87. var p = new RVector(29.9, 10.8);
  88. this.sendMouseEventModelPos(QEvent.MouseButtonPress, p, Qt.RightButton, 2, 0);
  89. this.verifyDrawing('LineVerticalTest00_000.dxf');
  90. this.tearDown();
  91. qDebug('finished LineVerticalTest00.test00()');
  92. };