1 /**
2 * UGENE - Integrated Bioinformatics Tools.
3 * Copyright (C) 2008-2021 UniPro <ugene@unipro.ru>
4 * http://ugene.net
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program 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 this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22 #include <GTGlobals.h>
23 #include <api/GTUtils.h>
24 #include <base_dialogs/GTFileDialog.h>
25 #include <base_dialogs/MessageBoxFiller.h>
26 #include <drivers/GTKeyboardDriver.h>
27 #include <drivers/GTMouseDriver.h>
28 #include <primitives/GTAction.h>
29 #include <primitives/GTCheckBox.h>
30 #include <primitives/GTComboBox.h>
31 #include <primitives/GTLineEdit.h>
32 #include <primitives/GTMenu.h>
33 #include <primitives/GTRadioButton.h>
34 #include <primitives/GTSpinBox.h>
35 #include <primitives/GTTabWidget.h>
36 #include <primitives/GTTableView.h>
37 #include <primitives/GTToolbar.h>
38 #include <primitives/GTTreeWidget.h>
39 #include <primitives/GTWidget.h>
40 #include <primitives/PopupChooser.h>
41 #include <runnables/ugene/plugins/external_tools/TCoffeeDailogFiller.h>
42 #include <system/GTClipboard.h>
43 #include <system/GTFile.h>
44 #include <utils/GTKeyboardUtils.h>
45 #include <utils/GTThread.h>
46 #include <utils/GTUtilsDialog.h>
47 #include <utils/GTUtilsToolTip.h>
48
49 #include <QDialogButtonBox>
50 #include <QFileDialog>
51 #include <QHeaderView>
52 #include <QMainWindow>
53 #include <QMenu>
54 #include <QPlainTextEdit>
55 #include <QPushButton>
56 #include <QTableWidget>
57 #include <QWizard>
58
59 #include <U2Core/AppContext.h>
60 #include <U2Core/ExternalToolRegistry.h>
61 #include <U2Core/U2ObjectDbi.h>
62 #include <U2Core/U2SafePoints.h>
63
64 #include <U2Gui/ToolsMenu.h>
65
66 #include <U2View/ADVConstants.h>
67 #include <U2View/ADVSingleSequenceWidget.h>
68 #include <U2View/AnnotatedDNAViewFactory.h>
69 #include <U2View/AnnotationsTreeView.h>
70 #include <U2View/MSAEditor.h>
71 #include <U2View/MaEditorNameList.h>
72
73 #include "../../workflow_designer/src/WorkflowViewItems.h"
74 #include "GTDatabaseConfig.h"
75 #include "GTTestsRegressionScenarios_2001_3000.h"
76 #include "GTUtilsAnnotationsTreeView.h"
77 #include "GTUtilsAssemblyBrowser.h"
78 #include "GTUtilsCircularView.h"
79 #include "GTUtilsDashboard.h"
80 #include "GTUtilsExternalTools.h"
81 #include "GTUtilsLog.h"
82 #include "GTUtilsMdi.h"
83 #include "GTUtilsMsaEditor.h"
84 #include "GTUtilsMsaEditorSequenceArea.h"
85 #include "GTUtilsNotifications.h"
86 #include "GTUtilsOptionPanelMSA.h"
87 #include "GTUtilsOptionPanelSequenceView.h"
88 #include "GTUtilsOptionsPanel.h"
89 #include "GTUtilsPhyTree.h"
90 #include "GTUtilsProject.h"
91 #include "GTUtilsProjectTreeView.h"
92 #include "GTUtilsSequenceView.h"
93 #include "GTUtilsSharedDatabaseDocument.h"
94 #include "GTUtilsTask.h"
95 #include "GTUtilsTaskTreeView.h"
96 #include "GTUtilsWizard.h"
97 #include "GTUtilsWorkflowDesigner.h"
98 #include "api/GTSequenceReadingModeDialog.h"
99 #include "api/GTSequenceReadingModeDialogUtils.h"
100 #include "runnables/ugene/corelibs/U2Gui/AlignShortReadsDialogFiller.h"
101 #include "runnables/ugene/corelibs/U2Gui/AppSettingsDialogFiller.h"
102 #include "runnables/ugene/corelibs/U2Gui/ConvertAssemblyToSAMDialogFiller.h"
103 #include "runnables/ugene/corelibs/U2Gui/CreateAnnotationWidgetFiller.h"
104 #include "runnables/ugene/corelibs/U2Gui/CreateDocumentFromTextDialogFiller.h"
105 #include "runnables/ugene/corelibs/U2Gui/CreateObjectRelationDialogFiller.h"
106 #include "runnables/ugene/corelibs/U2Gui/DownloadRemoteFileDialogFiller.h"
107 #include "runnables/ugene/corelibs/U2Gui/EditAnnotationDialogFiller.h"
108 #include "runnables/ugene/corelibs/U2Gui/EditConnectionDialogFiller.h"
109 #include "runnables/ugene/corelibs/U2Gui/EditQualifierDialogFiller.h"
110 #include "runnables/ugene/corelibs/U2Gui/FindQualifierDialogFiller.h"
111 #include "runnables/ugene/corelibs/U2Gui/FindTandemsDialogFiller.h"
112 #include "runnables/ugene/corelibs/U2Gui/ImportACEFileDialogFiller.h"
113 #include "runnables/ugene/corelibs/U2Gui/ImportAPRFileDialogFiller.h"
114 #include "runnables/ugene/corelibs/U2Gui/ImportBAMFileDialogFiller.h"
115 #include "runnables/ugene/corelibs/U2Gui/PositionSelectorFiller.h"
116 #include "runnables/ugene/corelibs/U2Gui/ProjectTreeItemSelectorDialogFiller.h"
117 #include "runnables/ugene/corelibs/U2Gui/RangeSelectionDialogFiller.h"
118 #include "runnables/ugene/corelibs/U2Gui/RemovePartFromSequenceDialogFiller.h"
119 #include "runnables/ugene/corelibs/U2View/ov_msa/BuildTreeDialogFiller.h"
120 #include "runnables/ugene/corelibs/U2View/ov_msa/ExportHighlightedDialogFiller.h"
121 #include "runnables/ugene/corelibs/U2View/ov_msa/ExtractSelectedAsMSADialogFiller.h"
122 #include "runnables/ugene/corelibs/U2View/ov_msa/LicenseAgreementDialogFiller.h"
123 #include "runnables/ugene/corelibs/U2View/utils_smith_waterman/SmithWatermanDialogBaseFiller.h"
124 #include "runnables/ugene/plugins/annotator/FindAnnotationCollocationsDialogFiller.h"
125 #include "runnables/ugene/plugins/dna_export/ExportAnnotationsDialogFiller.h"
126 #include "runnables/ugene/plugins/dna_export/ExportBlastResultDialogFiller.h"
127 #include "runnables/ugene/plugins/dna_export/ExportMSA2MSADialogFiller.h"
128 #include "runnables/ugene/plugins/dotplot/BuildDotPlotDialogFiller.h"
129 #include "runnables/ugene/plugins/dotplot/DotPlotDialogFiller.h"
130 #include "runnables/ugene/plugins/enzymes/FindEnzymesDialogFiller.h"
131 #include "runnables/ugene/plugins/external_tools/ClustalOSupportRunDialogFiller.h"
132 #include "runnables/ugene/plugins/external_tools/RemoteBLASTDialogFiller.h"
133 #include "runnables/ugene/plugins/workflow_designer/ConfigurationWizardFiller.h"
134 #include "runnables/ugene/plugins/workflow_designer/CreateElementWithCommandLineToolFiller.h"
135 #include "runnables/ugene/plugins/workflow_designer/CreateElementWithScriptDialogFiller.h"
136 #include "runnables/ugene/plugins/workflow_designer/DashboardsManagerDialogFiller.h"
137 #include "runnables/ugene/plugins/workflow_designer/DefaultWizardFiller.h"
138 #include "runnables/ugene/plugins/workflow_designer/StartupDialogFiller.h"
139 #include "runnables/ugene/plugins/workflow_designer/WizardFiller.h"
140 #include "runnables/ugene/plugins_3rdparty/MAFFT/MAFFTSupportRunDialogFiller.h"
141 #include "runnables/ugene/plugins_3rdparty/clustalw/ClustalWDialogFiller.h"
142 #include "runnables/ugene/plugins_3rdparty/hmm3/UHMM3PhmmerDialogFiller.h"
143 #include "runnables/ugene/plugins_3rdparty/kalign/KalignDialogFiller.h"
144 #include "runnables/ugene/plugins_3rdparty/umuscle/MuscleDialogFiller.h"
145 #include "runnables/ugene/ugeneui/DocumentFormatSelectorDialogFiller.h"
146 #include "runnables/ugene/ugeneui/NCBISearchDialogFiller.h"
147 #include "runnables/ugene/ugeneui/SaveProjectDialogFiller.h"
148 #include "runnables/ugene/ugeneui/SequenceReadingModeSelectorDialogFiller.h"
149
150 namespace U2 {
151
152 namespace GUITest_regression_scenarios {
153
GUI_TEST_CLASS_DEFINITION(test_2006)154 GUI_TEST_CLASS_DEFINITION(test_2006) {
155 const int MSA_WIDTH = 30;
156 const int MSA_HEIGHT = 3;
157
158 // 1. Open "data/samples/CLUSTAL/COI.aln" and save it's part to a string
159 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
160 GTUtilsTaskTreeView::waitTaskFinished(os);
161 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(MSA_WIDTH, MSA_HEIGHT));
162 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
163 const QString initialMsaContent = GTClipboard::text(os);
164 GTKeyboardDriver::keyClick(Qt::Key_Escape);
165
166 // 2. Select the second symbol in the first line
167 const QPoint initialSelectionPos(1, 0);
168 GTUtilsMSAEditorSequenceArea::click(os, initialSelectionPos);
169
170 // 3. Drag it to the first symbol in the first line
171 const QPoint mouseDragPosition(1, 0);
172 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition);
173 GTMouseDriver::press();
174 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition + QPoint(0, 0));
175 GTMouseDriver::release();
176 GTThread::waitForMainThread();
177
178 // 4. Check that the content has not been changed
179 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(MSA_WIDTH, MSA_HEIGHT));
180 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
181 const QString finalMsaContent = GTClipboard::text(os);
182 CHECK_SET_ERR(initialMsaContent == finalMsaContent, "MSA has unexpectedly changed");
183
184 // 5. Check that "Undo" and "Redo" buttons are disabled
185 const QAbstractButton *undo = GTAction::button(os, "msa_action_undo");
186 CHECK_SET_ERR(!undo->isEnabled(), "Undo button is unexpectedly enabled");
187 const QAbstractButton *redo = GTAction::button(os, "msa_action_redo");
188 CHECK_SET_ERR(!redo->isEnabled(), "Redo button is unexpectedly enabled");
189 }
190
GUI_TEST_CLASS_DEFINITION(test_2007)191 GUI_TEST_CLASS_DEFINITION(test_2007) {
192 // 1. Open "_common_data/scenarios/msa/ma_empty_line.aln (and save it to string)
193 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma_empty_line.aln");
194 GTUtilsTaskTreeView::waitTaskFinished(os);
195 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 4));
196 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
197 const QString initialMsaContent = GTClipboard::text(os);
198 GTKeyboardDriver::keyClick(Qt::Key_Escape);
199
200 // 2. Select the fourth column of the second, third and fourth lines
201 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(3, 1), QPoint(3, 3));
202
203 // 3. Drag it to the left.
204 const QPoint mouseDragPosition(3, 2);
205 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition);
206 GTMouseDriver::press();
207 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition - QPoint(1, 0));
208 GTMouseDriver::release();
209 GTThread::waitForMainThread();
210
211 // Expected state: nothing happens
212 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 4));
213 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
214 const QString finalMsaContent = GTClipboard::text(os);
215 CHECK_SET_ERR(initialMsaContent == finalMsaContent, "MSA has changed unexpectedly!");
216 }
217
GUI_TEST_CLASS_DEFINITION(test_2009)218 GUI_TEST_CLASS_DEFINITION(test_2009) {
219 // 1) Open Settings/Preferences/External tools
220 // 2) Set correct BWA or any other tool path (preferably just executable)
221 class BWAInactivation : public CustomScenario {
222 public:
223 void run(HI::GUITestOpStatus &os) {
224 // 3) Clear set path
225 AppSettingsDialogFiller::clearToolPath(os, "BWA");
226
227 QWidget *dialog = GTWidget::getActiveModalWidget(os);
228 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
229 }
230 };
231
232 GTLogTracer l;
233
234 GTUtilsDialog::waitForDialog(os, new AppSettingsDialogFiller(os, new BWAInactivation()));
235 GTMenu::clickMainMenuItem(os, QStringList() << "Settings"
236 << "Preferences...");
237 // 4) Look at UGENE log
238 GTUtilsLog::check(os, l);
239 // Expected state: UGENE doesn't write any error to log
240 }
241
GUI_TEST_CLASS_DEFINITION(test_2012)242 GUI_TEST_CLASS_DEFINITION(test_2012) {
243 // 1. Open {data/samples/CLUSTALW/COI.aln}.
244 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
245 GTUtilsTaskTreeView::waitTaskFinished(os);
246
247 // 2. Open the "General" tab on the options panel.
248 GTWidget::click(os, GTWidget::findWidget(os, "OP_MSA_GENERAL"));
249 QLineEdit *sequencelineEdit = (QLineEdit *)GTWidget::findWidget(os, "sequenceLineEdit");
250 CHECK(nullptr != sequencelineEdit, );
251
252 GTLineEdit::setText(os, sequencelineEdit, "m");
253
254 GTKeyboardDriver::keyClick(Qt::Key_Down);
255
256 GTKeyboardDriver::keyClick(Qt::Key_Down);
257
258 GTKeyboardDriver::keyClick(Qt::Key_Down);
259
260 GTKeyboardDriver::keyClick(Qt::Key_Enter);
261
262 QString selectedSequence = sequencelineEdit->text();
263 CHECK("Mecopoda_elongata__Sumatra_" == selectedSequence, );
264
265 // 3. Set focus to the reference sequence name line edit and enter 'm' into it.
266 }
267
GUI_TEST_CLASS_DEFINITION(test_2021_1)268 GUI_TEST_CLASS_DEFINITION(test_2021_1) {
269 // 1. Open document "ma.aln" and save it to string
270 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma.aln");
271 GTUtilsTaskTreeView::waitTaskFinished(os);
272 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 17));
273 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
274 const QString initialMsaContent = GTClipboard::text(os);
275 GTKeyboardDriver::keyClick(Qt::Key_Escape);
276
277 // 2. Select a character in the sequence area
278 const QPoint initialSelectionPos(10, 10);
279 GTUtilsMSAEditorSequenceArea::click(os, initialSelectionPos);
280
281 // 3. Add gaps by pressing "Space" key
282 const int totalShiftCount = 3;
283 int shiftCounter = 0;
284 QPoint currentSelection = initialSelectionPos;
285 while (shiftCounter++ < totalShiftCount) {
286 GTKeyboardDriver::keyClick(Qt::Key_Space);
287 }
288 currentSelection.rx() += totalShiftCount;
289
290 // 4. Remove gaps with "Backspace" key
291 shiftCounter = 0;
292 while (shiftCounter++ < totalShiftCount) {
293 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
294 currentSelection.rx() -= 1;
295 GTUtilsMSAEditorSequenceArea::checkSelectedRect(os, QRect(currentSelection, currentSelection));
296 }
297
298 // 5. Check that alignment content has returned to initial state
299 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 17));
300 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
301 const QString finalMsaContent = GTClipboard::text(os);
302 CHECK_SET_ERR(initialMsaContent == finalMsaContent, "MSA has unexpectedly changed");
303 }
304
GUI_TEST_CLASS_DEFINITION(test_2021_2)305 GUI_TEST_CLASS_DEFINITION(test_2021_2) {
306 // 1. Open document "ma.aln" and save it to string
307 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma.aln");
308 GTUtilsTaskTreeView::waitTaskFinished(os);
309 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 17));
310 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
311 const QString initialMsaContent = GTClipboard::text(os);
312 GTKeyboardDriver::keyClick(Qt::Key_Escape);
313
314 // 2. Select a region in the sequence area
315 const QPoint initialSelectionLeftTop(5, 5);
316 const QPoint initialSelectionRightBottom(11, 10);
317 const int selectionWidth = initialSelectionRightBottom.x() - initialSelectionLeftTop.x() + 1;
318 GTUtilsMSAEditorSequenceArea::selectArea(os, initialSelectionLeftTop, initialSelectionRightBottom);
319
320 // 3. Add gaps by pressing "Space" key
321 const int totalShiftCount = 3;
322 int shiftCounter = 0;
323 QPoint currentSelectionLeftTop = initialSelectionLeftTop;
324 QPoint currentSelectionRightBottom = initialSelectionRightBottom;
325 while (shiftCounter++ < totalShiftCount) {
326 GTKeyboardDriver::keyClick(Qt::Key_Space);
327 }
328 currentSelectionLeftTop.rx() += totalShiftCount * selectionWidth;
329 currentSelectionRightBottom.rx() += totalShiftCount * selectionWidth;
330 GTUtilsMSAEditorSequenceArea::checkSelectedRect(os, QRect(currentSelectionLeftTop, currentSelectionRightBottom));
331
332 // 4. Remove gaps with "Backspace" key
333 shiftCounter = 0;
334 while (shiftCounter++ < totalShiftCount) {
335 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
336 currentSelectionLeftTop.rx() -= selectionWidth;
337 currentSelectionRightBottom.rx() -= selectionWidth;
338 GTUtilsMSAEditorSequenceArea::checkSelectedRect(os, QRect(currentSelectionLeftTop, currentSelectionRightBottom));
339 }
340
341 // 5. Check that alignment content has returned to initial state
342 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 17));
343 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
344 const QString finalMsaContent = GTClipboard::text(os);
345 CHECK_SET_ERR(initialMsaContent == finalMsaContent, "MSA has unexpectedly changed");
346 }
347
GUI_TEST_CLASS_DEFINITION(test_2021_3)348 GUI_TEST_CLASS_DEFINITION(test_2021_3) {
349 // 1. Open document "ma2_gap_8_col.aln"
350 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma2_gap_8_col.aln");
351 GTUtilsTaskTreeView::waitTaskFinished(os);
352
353 // 2. Select a column in the sequence area
354 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(0, 0));
355 GTMouseDriver::click();
356 GTUtilsMSAEditorSequenceArea::selectColumnInConsensus(os, 9);
357
358 // 3. Remove gap columns by pressing "Backspace" key
359 const int totalShiftCount = 6;
360 int shiftCounter = 0;
361 while (shiftCounter++ < totalShiftCount) {
362 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
363 }
364
365 // 4. Check that all the empty columns were removed
366 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(14, 9));
367 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
368 const QString finalMsaContent = GTClipboard::text(os);
369 CHECK_SET_ERR("AAGCTTCTTTTAA--\nAAGTTACTAA-----\nTAG---TTATTAA--\nAAGC---TATTAA--\n"
370 "TAGTTATTAA-----\nTAGTTATTAA-----\nTAGTTATTAA-----\nAAGCTTT---TAA--\n"
371 "A--AGAATAATTA--\nAAGCTTTTAA-----" == finalMsaContent,
372 "Unexpected MSA content has occurred\n expected: \nAAGCTTCTTTTAA--\nAAGTTACTAA-----\nTAG---TTATTAA--\nAAGC---TATTAA--\n"
373 "TAGTTATTAA-----\nTAGTTATTAA-----\nTAGTTATTAA-----\nAAGCTTT---TAA--\n"
374 "A--AGAATAATTA--\nAAGCTTTTAA-----\n actual: \n" +
375 finalMsaContent);
376 }
377
GUI_TEST_CLASS_DEFINITION(test_2021_4)378 GUI_TEST_CLASS_DEFINITION(test_2021_4) {
379 // 1. Open document "ma2_gap_8_col.aln" and save it to string
380 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma2_gap_8_col.aln");
381 GTUtilsTaskTreeView::waitTaskFinished(os);
382 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(20, 9));
383 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
384 const QString initialMsaContent = GTClipboard::text(os);
385 GTKeyboardDriver::keyClick(Qt::Key_Escape);
386
387 // 2. Select a region of trailing gaps
388 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(17, 4), QPoint(19, 6));
389
390 // 3. Press "Backspace"
391 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
392
393 // 4. Check that MSA does not changed
394 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(20, 9));
395 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
396 const QString finalMsaContent = GTClipboard::text(os);
397 CHECK_SET_ERR(initialMsaContent == finalMsaContent, "MSA has unexpectedly changed");
398
399 // 5. Check that "Undo" and "Redo" buttons are disabled
400 const QAbstractButton *undo = GTAction::button(os, "msa_action_undo");
401 CHECK_SET_ERR(!undo->isEnabled(), "Undo button is unexpectedly enabled");
402 const QAbstractButton *redo = GTAction::button(os, "msa_action_redo");
403 CHECK_SET_ERR(!redo->isEnabled(), "Redo button is unexpectedly enabled");
404 }
405
GUI_TEST_CLASS_DEFINITION(test_2021_5)406 GUI_TEST_CLASS_DEFINITION(test_2021_5) {
407 // 1. Open document "ma2_gap_8_col.aln"
408 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma2_gap_8_col.aln");
409 GTUtilsTaskTreeView::waitTaskFinished(os);
410
411 // 2. Select a column in the sequence area
412 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(9, 0), QPoint(16, 9));
413
414 // 3. Remove gap columns by pressing "Backspace" key
415 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
416
417 // 4. Check that all the empty columns were removed
418 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(14, 9));
419 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
420 const QString finalMsaContent = GTClipboard::text(os);
421 CHECK_SET_ERR("AAGCTTCTTTTAA--\nAAGTTACTAA-----\nTAG---TTATTAA--\nAAGC---TATTAA--\n"
422 "TAGTTATTAA-----\nTAGTTATTAA-----\nTAGTTATTAA-----\nAAGCTTT---TAA--\n"
423 "A--AGAATAATTA--\nAAGCTTTTAA-----" == finalMsaContent,
424 "Unexpected MSA content has occurred");
425 }
426
GUI_TEST_CLASS_DEFINITION(test_2021_6)427 GUI_TEST_CLASS_DEFINITION(test_2021_6) {
428 // 1. Open "data/samples/CLUSTAL/COI.aln".
429 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
430 GTUtilsTaskTreeView::waitTaskFinished(os);
431 if (GTUtilsProjectTreeView::isVisible(os)) {
432 GTUtilsProjectTreeView::toggleView(os);
433 }
434
435 // 2. Set cursor to the position 45 of the first line (after gaps).
436 // const QPoint initialSelectionPos(44, 0);
437 // GTUtilsMSAEditorSequenceArea::click(os, initialSelectionPos);
438 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(44, 0), QPoint(44, 0));
439
440 // 3. Press BACKSPACE
441 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
442
443 // 4. Expected state: the gap was deleted, selection moves to the previous symbol.
444 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(43, 0));
445 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
446
447 const QString finalMsaContent = GTClipboard::text(os);
448 CHECK_SET_ERR("TAAGACTTCTAATTCGAGCCGAATTAGGTCAACCAGGATAC--C" == finalMsaContent,
449 QString("Unexpected MSA content has occurred: got %1").arg(finalMsaContent));
450 }
451
GUI_TEST_CLASS_DEFINITION(test_2021_7)452 GUI_TEST_CLASS_DEFINITION(test_2021_7) {
453 // 1. Open test/_common_data/scenarios/msa/ma2_gap_col.aln.
454 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma2_gap_col.aln");
455 GTUtilsTaskTreeView::waitTaskFinished(os);
456
457 // 2. Select the 8 and 9 of the third line (two symbols after gaps).
458 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(7, 2), QPoint(8, 2));
459
460 // 3. Press BACKSPACE
461 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
462
463 // 4. Expected state: the gap was deleted, selection moves to the previous symbol.
464 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 2), QPoint(13, 2));
465 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
466 const QString finalMsaContent = GTClipboard::text(os);
467 CHECK_SET_ERR("TAG--TTATTAA--" == finalMsaContent,
468 QString("Unexpected MSA content has occurred: got %1").arg(finalMsaContent));
469 }
470
GUI_TEST_CLASS_DEFINITION(test_2021_8)471 GUI_TEST_CLASS_DEFINITION(test_2021_8) {
472 // 1. Open "data/samples/CLUSTAL/COI.aln".
473 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
474 GTUtilsTaskTreeView::waitTaskFinished(os);
475 if (GTUtilsProjectTreeView::isVisible(os)) {
476 GTUtilsProjectTreeView::toggleView(os);
477 }
478
479 // 2. Select the 45 and 46 of the second line (two symbols after gaps).
480 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(44, 1), QPoint(45, 1));
481
482 // 3. Press BACKSPACE
483 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
484
485 // 4. Expected state: the gap was deleted, selection moves to the previous symbol.
486 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 1), QPoint(44, 1));
487 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
488 const QString finalMsaContent = GTClipboard::text(os);
489 CHECK_SET_ERR("TAAGCTTACTAATCCGGGCCGAATTAGGTCAACCTGGTTAT-CTA" == finalMsaContent,
490 QString("Unexpected MSA content has occurred: got %1").arg(finalMsaContent));
491 }
492
GUI_TEST_CLASS_DEFINITION(test_2021_9)493 GUI_TEST_CLASS_DEFINITION(test_2021_9) {
494 // 1. Open "data/samples/CLUSTAL/COI.aln".
495 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
496 GTUtilsTaskTreeView::waitTaskFinished(os);
497 if (GTUtilsProjectTreeView::isVisible(os)) {
498 GTUtilsProjectTreeView::toggleView(os);
499 }
500
501 // 2. Select the 45 and 46 of the second line (two symbols after gaps).
502 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(44, 2), QPoint(46, 2));
503
504 // 3. Press BACKSPACE
505 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
506
507 // 4. Expected state: the gap was deleted, selection moves to the previous symbol.
508 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 2), QPoint(46, 2));
509 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
510 const QString finalMsaContent = GTClipboard::text(os);
511 CHECK_SET_ERR("TTAGTTTATTAATTCGAGCTGAACTAGGTCAACCAGGCTATTTAATT" == finalMsaContent,
512 QString("Unexpected MSA content has occurred: got %1").arg(finalMsaContent));
513 }
514
GUI_TEST_CLASS_DEFINITION(test_2026)515 GUI_TEST_CLASS_DEFINITION(test_2026) {
516 // 1. Open data/samples/CLUSTALW/COI.aln
517 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
518 GTUtilsTaskTreeView::waitTaskFinished(os);
519
520 // 2. Select Montana_montana in name list
521 GTUtilsMSAEditorSequenceArea::selectSequence(os, QString("Montana_montana"));
522
523 // 3. Press shift, click down_arrow 4 times. Release shift.
524 GTKeyboardDriver::keyPress(Qt::Key_Shift);
525 for (int i = 0; i < 4; ++i) {
526 GTKeyboardDriver::keyClick(Qt::Key_Down);
527 }
528 GTKeyboardDriver::keyRelease(Qt::Key_Shift);
529 GTUtilsTaskTreeView::waitTaskFinished(os);
530
531 // Expected state: 5 sequences are selected
532 CHECK_SET_ERR(5 == GTUtilsMSAEditorSequenceArea::getSelectedSequencesNum(os),
533 QString("Unexpected number of selected sequences1. Got %1, Expected %2").arg(GTUtilsMSAEditorSequenceArea::getSelectedSequencesNum(os)).arg(5));
534 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::isSequenceSelected(os, QString("Montana_montana")),
535 "Expected sequence is not selected");
536 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::isSequenceSelected(os, QString("Zychia_baranovi")),
537 "Expected sequence is not selected");
538
539 // 4. Release shift. Press shift again and click down arrow
540 GTKeyboardDriver::keyPress(Qt::Key_Shift);
541 GTKeyboardDriver::keyClick(Qt::Key_Down);
542 GTKeyboardDriver::keyRelease(Qt::Key_Shift);
543 GTUtilsTaskTreeView::waitTaskFinished(os);
544
545 // Expected state: 6 sequences selected
546 CHECK_SET_ERR(6 == GTUtilsMSAEditorSequenceArea::getSelectedSequencesNum(os),
547 QString("Unexpected number of selected sequences2. Got %1, Expected %2").arg(GTUtilsMSAEditorSequenceArea::getSelectedSequencesNum(os)).arg(6));
548 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::isSequenceSelected(os, QString("Montana_montana")),
549 "Expected sequence is not selected");
550 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::isSequenceSelected(os, QString("Zychia_baranovi")),
551 "Expected sequence is not selected");
552 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::isSequenceSelected(os, QString("Tettigonia_viridissima")),
553 "Expected sequence is not selected");
554 }
555
GUI_TEST_CLASS_DEFINITION(test_2030)556 GUI_TEST_CLASS_DEFINITION(test_2030) {
557 // 1. Open {_common_data/scenarios/msa/ma_one_line.aln}
558 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa/", "ma_one_line.aln");
559 GTUtilsTaskTreeView::waitTaskFinished(os);
560
561 // 2. Set cursor to the end of the line
562 const QPoint endLinePos(11, 0);
563 GTUtilsMSAEditorSequenceArea::click(os, endLinePos);
564
565 // 3. Insert four gaps with SPACE.
566 for (int i = 0; i < 4; ++i) {
567 GTKeyboardDriver::keyClick(Qt::Key_Space);
568 }
569
570 // 4. Set cursor to the beginning of the line
571 const QPoint begLinePos(0, 0);
572 GTUtilsMSAEditorSequenceArea::click(os, begLinePos);
573
574 // 5. Delete one symbol with DELETE
575 GTKeyboardDriver::keyClick(Qt::Key_Delete);
576
577 // Expected state: line length is 15.
578 CHECK_SET_ERR(15 == GTUtilsMSAEditorSequenceArea::getLength(os),
579 "Unexpected MSA length!");
580 }
581
GUI_TEST_CLASS_DEFINITION(test_2032)582 GUI_TEST_CLASS_DEFINITION(test_2032) {
583 // 1. Open {_common_data/fasta/abcd.fa} as separate sequences
584 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Separate));
585 GTFileDialog::openFileWithDialog(os, testDir, "_common_data/fasta/abcd.fa");
586 GTUtilsTaskTreeView::waitTaskFinished(os);
587
588 // Expected result: order of sequences in the project view is {d, a, c, b}
589 QModelIndex documentItem = GTUtilsProjectTreeView::findIndex(os, "abcd.fa");
590
591 CHECK_SET_ERR(documentItem.child(0, 0).data() == "[s] a", "1. Unexpected name of the object in the project view!");
592 CHECK_SET_ERR(documentItem.child(1, 0).data() == "[s] b", "2. Unexpected name of the object in the project view!");
593 CHECK_SET_ERR(documentItem.child(2, 0).data() == "[s] c", "3. Unexpected name of the object in the project view!");
594 CHECK_SET_ERR(documentItem.child(3, 0).data() == "[s] d", "4. Unexpected name of the object in the project view!");
595
596 // Expected result: order of sequences in the sequences view is {d, a, c, b}
597 GTUtilsSequenceView::checkSequenceViewWindowIsActive(os);
598 ADVSingleSequenceWidget *seq0 = dynamic_cast<ADVSingleSequenceWidget *>(GTWidget::findWidget(os, "ADV_single_sequence_widget_0"));
599 ADVSingleSequenceWidget *seq1 = dynamic_cast<ADVSingleSequenceWidget *>(GTWidget::findWidget(os, "ADV_single_sequence_widget_1"));
600 ADVSingleSequenceWidget *seq2 = dynamic_cast<ADVSingleSequenceWidget *>(GTWidget::findWidget(os, "ADV_single_sequence_widget_2"));
601 ADVSingleSequenceWidget *seq3 = dynamic_cast<ADVSingleSequenceWidget *>(GTWidget::findWidget(os, "ADV_single_sequence_widget_3"));
602
603 CHECK_SET_ERR(seq0 != nullptr, "1. Failed to find a sequence widget!");
604 CHECK_SET_ERR(seq1 != nullptr, "2. Failed to find a sequence widget!");
605 CHECK_SET_ERR(seq2 != nullptr, "3. Failed to find a sequence widget!");
606 CHECK_SET_ERR(seq3 != nullptr, "4. Failed to find a sequence widget!");
607
608 CHECK_SET_ERR(seq0->getSequenceObject()->getSequenceName() == "d", "1. Unexpected sequence name!");
609 CHECK_SET_ERR(seq1->getSequenceObject()->getSequenceName() == "a", "2. Unexpected sequence name!");
610 CHECK_SET_ERR(seq2->getSequenceObject()->getSequenceName() == "c", "3. Unexpected sequence name!");
611 CHECK_SET_ERR(seq3->getSequenceObject()->getSequenceName() == "b", "4. Unexpected sequence name!");
612 }
613
GUI_TEST_CLASS_DEFINITION(test_2049)614 GUI_TEST_CLASS_DEFINITION(test_2049) {
615 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
616 GTUtilsTaskTreeView::waitTaskFinished(os);
617
618 GTWidget::click(os, GTToolbar::getWidgetForActionObjectName(os, GTToolbar::getToolbar(os, MWTOOLBAR_ACTIVEMDI), "Codon table"));
619 QWidget *w = GTWidget::findWidget(os, "Codon table widget");
620 int ititHeight = GTWidget::findWidget(os, "Leucine (Leu, L)", w)->geometry().height();
621
622 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "3. The Yeast Mitochondrial Code"));
623 GTWidget::click(os, GTWidget::findWidget(os, "AminoToolbarButton"));
624
625 w = GTWidget::findWidget(os, "Codon table widget");
626 int finalHeight = GTWidget::findWidget(os, "Leucine (Leu, L)", w)->geometry().height();
627 CHECK_SET_ERR(ititHeight != finalHeight, "codon table not changed");
628 }
629
GUI_TEST_CLASS_DEFINITION(test_2053)630 GUI_TEST_CLASS_DEFINITION(test_2053) {
631 // 1. Remove UGENE .ini file
632 // 2. Run UGENE
633 // 3. Open WD
634 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
635 // 4. Run some scheme
636 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Alignment");
637 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Alignment");
638 GTUtilsWorkflowDesigner::connect(os, read, write);
639 GTUtilsWorkflowDesigner::click(os, "Read Alignment");
640 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/CLUSTALW/COI.aln");
641 GTUtilsWorkflowDesigner::runWorkflow(os);
642 // Expected state: after scheme finish there is the hint on the dashboard -
643 GTUtilsTaskTreeView::waitTaskFinished(os);
644
645 QToolButton *loadSchemaButton = GTUtilsDashboard::findLoadSchemaButton(os);
646 CHECK_SET_ERR(loadSchemaButton, "loadSchemaButton not found");
647
648 CHECK_SET_ERR(loadSchemaButton->toolTip() == "Open workflow schema", "loadSchemaButton has no hint")
649 }
650
GUI_TEST_CLASS_DEFINITION(test_2076)651 GUI_TEST_CLASS_DEFINITION(test_2076) {
652 // 1) Open WD
653 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
654 // 2) Run any scheme
655 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Alignment");
656 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Alignment");
657 GTUtilsWorkflowDesigner::connect(os, read, write);
658 GTUtilsWorkflowDesigner::click(os, read);
659 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/CLUSTALW/COI.aln");
660 GTUtilsWorkflowDesigner::saveWorkflowAs(os, sandBoxDir + "test_2076.uwl", "test_2076");
661 GTUtilsWorkflowDesigner::runWorkflow(os);
662 GTGlobals::sleep();
663 // Expected state: workflow monitor appeared
664
665 // 3) Click on the 'Dashboards manager' tool button
666 QWidget *dmButton = GTAction::button(os, GTAction::findAction(os, "Dashboards manager"));
667 GTWidget::click(os, dmButton);
668 // Expected state: 'Dashboards manager' dialog appeared
669 class custom : public CustomScenario {
670 public:
671 void run(HI::GUITestOpStatus &os) {
672 // 4) Select some dashboards in the dialog
673 QWidget *dialog = GTWidget::getActiveModalWidget(os);
674 // 5) Click on the 'Remove selected' button
675 DashboardsManagerDialogFiller::selectDashboards(os, QStringList() << "test_2076 1");
676 // Expected state: 'Removing dashboards' dialog appeared
677 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "Confirm"));
678 // 6) Click on the 'Confirm' button
679 GTWidget::click(os, GTWidget::findWidget(os, "removeButton", dialog));
680
681 // Expected state: selected dashboards were removed
682 bool pres = DashboardsManagerDialogFiller::isDashboardPresent(os, "test_2076 1");
683 CHECK_SET_ERR(!pres, "dashboard unexpectidly present")
684
685 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
686 }
687 };
688 GTUtilsDialog::waitForDialog(os, new DashboardsManagerDialogFiller(os, new custom()));
689 GTGlobals::sleep();
690 }
691
GUI_TEST_CLASS_DEFINITION(test_2077)692 GUI_TEST_CLASS_DEFINITION(test_2077) {
693 // 1) Open WD
694
695 // 2) Add elements "Read Sequence" and "Write sequence" to the scheme
696 // 3) Connect "Read Sequence" to "Write sequence"
697
698 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
699
700 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
701 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Sequence", true);
702
703 WorkflowProcessItem *seqReader = GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence");
704 WorkflowProcessItem *seqWriter = GTUtilsWorkflowDesigner::getWorker(os, "Write Sequence");
705
706 GTUtilsWorkflowDesigner::connect(os, seqReader, seqWriter);
707
708 // 4) Add file "human_T1.fa" to "Read Sequence" twice
709
710 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
711 GTMouseDriver::click();
712 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/FASTA/human_T1.fa");
713
714 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
715 GTMouseDriver::click();
716 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/FASTA/human_T1.fa");
717
718 // 5) Validate scheme
719 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "Workflow is valid"));
720 GTWidget::click(os, GTAction::button(os, "Validate workflow"));
721
722 // Expected state: The "File not found" error has appeared in the "Error list"
723 GTUtilsWorkflowDesigner::checkErrorList(os, "file '../human_T1.fa' was specified several times");
724 }
725
GUI_TEST_CLASS_DEFINITION(test_2078)726 GUI_TEST_CLASS_DEFINITION(test_2078) {
727 // 1. Go to the WD samples. Double click on the Chip-Seq WD sample.
728 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
729 // Expexted: setup dialog appears.
730 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Cistrome Workflow", QStringList() << "Only treatment tags"));
731
732 class customWizard : public CustomScenario {
733 public:
734 void run(HI::GUITestOpStatus &os) {
735 QWidget *dialog = GTWidget::getActiveModalWidget(os);
736 QWizard *wizard = qobject_cast<QWizard *>(dialog);
737 CHECK_SET_ERR(wizard, "activeModalWidget is not wizard");
738
739 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
740 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
741 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
742 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
743 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
744
745 QComboBox *combo = GTWidget::findExactWidget<QComboBox *>(os, "Motif database widget", dialog);
746 GTComboBox::checkValues(os, combo, QStringList() << "cistrome.xml"
747 << "jaspar.xml");
748
749 QList<QLabel *> labelList = wizard->currentPage()->findChildren<QLabel *>();
750 bool found = false;
751 foreach (QLabel *l, labelList) {
752 if (l->text().contains("Use 'cistrome.xml' to descrease the computation time")) {
753 CHECK_SET_ERR(l->isVisible(), "hint is invisiable");
754 found = true;
755 break;
756 }
757 }
758 CHECK_SET_ERR(found, "hint label not found");
759
760 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
761 dialog = QApplication::activeModalWidget();
762 if (dialog != nullptr) {
763 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
764 }
765 }
766 };
767 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "ChIP-seq Analysis Wizard", new customWizard));
768 GTUtilsWorkflowDesigner::addSample(os, "Cistrome");
769
770 // 4. In 'Motif database' combobox select following databases: 'cistrome.xml', 'jaspar.xml'
771 // Expected state: hint was appeared and contains following text "Use 'cistrome.xml' to decrease computation time..."
772 }
773
GUI_TEST_CLASS_DEFINITION(test_2089)774 GUI_TEST_CLASS_DEFINITION(test_2089) {
775 // 1. Start UGENE with a new *.ini file.
776 GTUtilsDialog::waitForDialog(os, new StartupDialogFiller(os, "!@#$%^&*()_+\";:?/", false));
777
778 // 2. Open WD
779 // 3. Set any folder without write access as workflow output folder. Click OK.
780 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
781 << "Workflow Designer...");
782 }
783
GUI_TEST_CLASS_DEFINITION(test_2100_1)784 GUI_TEST_CLASS_DEFINITION(test_2100_1) {
785 // 1. Open COI.aln
786 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
787 GTUtilsTaskTreeView::waitTaskFinished(os);
788
789 // 2. Click toolbutton "Enable collapsing"
790 GTUtilsMsaEditor::toggleCollapsingMode(os);
791
792 // expected state: Mecopoda_elongata__Ishigaki__J and Mecopoda_elongata__Sumatra_ are collapsed
793 CHECK_SET_ERR(!GTUtilsMSAEditorSequenceArea::isSequenceVisible(os, QString("Mecopoda_elongata__Sumatra_")),
794 "Required sequence is not collapsed");
795
796 // 3. Select Mecopoda_sp.__Malaysia_
797 GTUtilsMSAEditorSequenceArea::selectSequence(os, QString("Mecopoda_sp.__Malaysia_"));
798
799 // 4. Expand Mecopoda_elongata__Ishigaki__J
800
801 // Expected state: Mecopoda_sp.__Malaysia_ is still selected
802 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::isSequenceSelected(os, QString("Mecopoda_sp.__Malaysia_")),
803 "Expected sequence is not selected");
804 }
805
GUI_TEST_CLASS_DEFINITION(test_2100_2)806 GUI_TEST_CLASS_DEFINITION(test_2100_2) {
807 // 1. Open COI.aln
808 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
809 GTUtilsTaskTreeView::waitTaskFinished(os);
810
811 // 2. Click toolbutton "Enable collapsing"
812 GTUtilsMsaEditor::toggleCollapsingMode(os);
813
814 // 3. Select Mecopoda_sp.__Malaysia_
815 GTUtilsMSAEditorSequenceArea::selectSequence(os, QString("Mecopoda_sp.__Malaysia_"));
816
817 // 4. Expand Select Mecopoda_sp.__Malaysia_
818 // Expected state: Mecopoda_elongata__Ishigaki__J and Mecopoda_elongata__Sumatra_ are selected
819 }
820
GUI_TEST_CLASS_DEFINITION(test_2124)821 GUI_TEST_CLASS_DEFINITION(test_2124) {
822 // 1. Open "data/samples/CLUSTALW/ty3.aln.gz".
823 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "ty3.aln.gz");
824 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
825
826 // 2. Call the context menu on the sequence area.
827 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(1, 1));
828 const QString colorSchemeName = name + "_Scheme";
829 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_APPEARANCE << "Colors"
830 << "Custom schemes"
831 << "Create new color scheme"));
832 GTUtilsDialog::waitForDialog(os, new NewColorSchemeCreator(os, colorSchemeName, NewColorSchemeCreator::amino));
833 GTMouseDriver::click(Qt::RightButton);
834 GTUtilsDialog::waitAllFinished(os);
835
836 // 3. Create a new color scheme for the amino alphabet.
837 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(1, 1));
838 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_APPEARANCE << "Colors"
839 << "Custom schemes" << colorSchemeName));
840 GTMouseDriver::click(Qt::RightButton);
841 GTUtilsDialog::waitAllFinished(os);
842 }
843
GUI_TEST_CLASS_DEFINITION(test_2091)844 GUI_TEST_CLASS_DEFINITION(test_2091) {
845 // 1. Open "data/samples/CLUSTALW/COI.aln".
846 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
847 GTUtilsTaskTreeView::waitTaskFinished(os);
848
849 // Expected state: document are opened in the project view; MSA Editor are shown with test_alignment.
850 GTUtilsProjectTreeView::findIndex(os, "COI.aln");
851 QWidget *msaView = GTUtilsMdi::activeWindow(os);
852 CHECK(nullptr != msaView, );
853
854 // 2. Select any sequence.
855 GTUtilsMSAEditorSequenceArea::click(os, QPoint(-5, 4));
856 QStringList originalNames = GTUtilsMSAEditorSequenceArea::getNameList(os);
857
858 // 3. Call context menu on the name list area, select the {Edit -> Remove sequence} menu item.
859 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EDIT << "Remove sequence"));
860 GTMouseDriver::click(Qt::RightButton);
861 // Expected state: the sequence is removed.
862 QStringList modifiedNames = GTUtilsMSAEditorSequenceArea::getNameList(os);
863
864 CHECK_SET_ERR(originalNames.length() - modifiedNames.length() == 1, "The number of sequences remained unchanged.");
865 CHECK_SET_ERR(!modifiedNames.contains("Montana_montana"), "Removed sequence is present in multiple alignment.");
866 }
867
GUI_TEST_CLASS_DEFINITION(test_2093_1)868 GUI_TEST_CLASS_DEFINITION(test_2093_1) {
869 // 1. Run a scheme, e.g. "Call variants with SAMtools" from the NGS samples (or any other like read->write).
870 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
871
872 // Simple scheme: read file list.
873 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read File URL(s)");
874 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read File URL(s)"));
875 GTMouseDriver::click();
876 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/FASTA/human_T1.fa");
877
878 GTUtilsWorkflowDesigner::runWorkflow(os);
879
880 // 2. Select "Load schema" button on the dashboard menu line.
881 QToolButton *loadSchemaButton = GTUtilsDashboard::findLoadSchemaButton(os);
882 CHECK_SET_ERR(loadSchemaButton, "loadSchemaButton not found");
883
884 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Discard));
885 GTWidget::click(os, loadSchemaButton);
886
887 // Expected result: the scheme with parameters is loaded.
888 WorkflowProcessItem *wdElement = GTUtilsWorkflowDesigner::getWorker(os, "Read File URL(s)");
889 CHECK_SET_ERR(wdElement, "Schema wasn't loaded");
890 }
891
GUI_TEST_CLASS_DEFINITION(test_2093_2)892 GUI_TEST_CLASS_DEFINITION(test_2093_2) {
893 // 1. Open WD.
894 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
895
896 // 2. Open any shema with the "Load workflow" button on the toolbar (not the "Open" button!)
897 QString schemaPath = testDir + "_common_data/scenarios/workflow designer/222.uwl";
898 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, schemaPath));
899
900 QToolBar *wdToolbar = GTToolbar::getToolbar(os, "mwtoolbar_activemdi");
901 CHECK_SET_ERR(wdToolbar, "Toolbar not found");
902 QWidget *loadButton = GTToolbar::getWidgetForActionObjectName(os, wdToolbar, "Load workflow");
903 CHECK_SET_ERR(loadButton, "Load button not found");
904 GTWidget::click(os, loadButton);
905
906 // Expected result: the scheme with parameters is loaded.
907
908 WorkflowProcessItem *wdElement = GTUtilsWorkflowDesigner::getWorker(os, "Read sequence");
909 CHECK_SET_ERR(wdElement, "Schema wasn't loaded");
910 }
911
GUI_TEST_CLASS_DEFINITION(test_2128)912 GUI_TEST_CLASS_DEFINITION(test_2128) {
913 // 1. Open document "ma.aln" and save it to string
914 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma.aln");
915 GTUtilsTaskTreeView::waitTaskFinished(os);
916 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 17));
917 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
918 const QString initialMsaContent = GTClipboard::text(os);
919 GTKeyboardDriver::keyClick(Qt::Key_Escape);
920
921 // 2. Select a region in the sequence area
922 QRect currentSelection(QPoint(2, 5), QPoint(8, 11));
923 GTUtilsMSAEditorSequenceArea::selectArea(os, currentSelection.topLeft(), currentSelection.bottomRight());
924
925 // 3. Add gaps by pressing "Ctrl + Space" key
926 const int totalShiftCount = 3;
927 for (int shiftCounter = 0; shiftCounter < totalShiftCount; ++shiftCounter) {
928 GTKeyboardDriver::keyClick(Qt::Key_Space, Qt::ControlModifier);
929 currentSelection.moveRight(currentSelection.right() + 1);
930 GTUtilsMSAEditorSequenceArea::checkSelectedRect(os, currentSelection);
931 }
932
933 // 4. Remove gaps with "Ctrl + Backspace" key
934 for (int shiftCounter = 0; shiftCounter < totalShiftCount; ++shiftCounter) {
935 GTKeyboardDriver::keyClick(Qt::Key_Backspace, Qt::ControlModifier);
936 currentSelection.moveLeft(currentSelection.left() - 1);
937 GTUtilsMSAEditorSequenceArea::checkSelectedRect(os, currentSelection);
938 }
939
940 // 5. Check that alignment content has returned to initial state
941 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 17));
942 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
943 const QString finalMsaContent = GTClipboard::text(os);
944 CHECK_SET_ERR(initialMsaContent == finalMsaContent, "MSA has unexpectedly changed");
945 }
946
GUI_TEST_CLASS_DEFINITION(test_2128_1)947 GUI_TEST_CLASS_DEFINITION(test_2128_1) {
948 // 1. Open "data/samples/CLUSTAL/COI.aln".
949 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
950 GTUtilsTaskTreeView::waitTaskFinished(os);
951
952 // 2. Select the six first symbols in the first sequence and press Space.
953 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(5, 0));
954 GTKeyboardDriver::keyClick(Qt::Key_Space);
955
956 // Expected state: The first symbol T is on the 7 position.
957 GTKeyboardDriver::keyClick(Qt::Key_Escape);
958 const QPoint initialSelectionPos(6, 0);
959 GTUtilsMSAEditorSequenceArea::click(os, initialSelectionPos);
960 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
961 GTKeyboardDriver::keyClick(Qt::Key_Escape);
962 const QString finalMsaContent = GTClipboard::text(os);
963 CHECK_SET_ERR("T" == finalMsaContent,
964 "Unexpected MSA content has occurred");
965
966 // 3. Press the Ctrl + Space.
967 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(6, 0), QPoint(12, 0));
968 GTKeyboardDriver::keyClick(Qt::Key_Space, Qt::ControlModifier);
969
970 // Expected state: The first symbol T is on the 8 position.
971 GTKeyboardDriver::keyClick(Qt::Key_Escape);
972 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(7, 0), QPoint(7, 0));
973 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
974 GTKeyboardDriver::keyClick(Qt::Key_Escape);
975 const QString finalMsaContent1 = GTClipboard::text(os);
976 CHECK_SET_ERR("T" == finalMsaContent1,
977 "Unexpected MSA content has occurred");
978
979 // 4. Press the Ctrl + Backspace.
980 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(7, 0), QPoint(13, 0));
981 GTKeyboardDriver::keyClick(Qt::Key_Backspace, Qt::ControlModifier);
982
983 // Expected state: The first symbol T is on the 8 position.
984 GTKeyboardDriver::keyClick(Qt::Key_Escape);
985 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(6, 0), QPoint(6, 0));
986 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
987 GTKeyboardDriver::keyClick(Qt::Key_Escape);
988 const QString finalMsaContent2 = GTClipboard::text(os);
989 CHECK_SET_ERR("T" == finalMsaContent2,
990 "Unexpected MSA content has occurred");
991
992 // 5. Press the Backspace.
993 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(6, 0), QPoint(12, 0));
994 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
995
996 // Expected state: The first symbol T is on the 1 position.
997 GTKeyboardDriver::keyClick(Qt::Key_Escape);
998 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(0, 0));
999 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
1000 GTKeyboardDriver::keyClick(Qt::Key_Escape);
1001 const QString finalMsaContent3 = GTClipboard::text(os);
1002 CHECK_SET_ERR("T" == finalMsaContent3,
1003 "Unexpected MSA content has occurred");
1004 }
1005
GUI_TEST_CLASS_DEFINITION(test_2138)1006 GUI_TEST_CLASS_DEFINITION(test_2138) {
1007 // 1. Open _common_data/scenarios/_regression/2138/1.fa
1008 // 2. Press "Join sequences into alignment..." radio button
1009 // 3. Press "OK" button
1010 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Join));
1011 GTUtilsProject::openFile(os, testDir + "_common_data/scenarios/_regression/2138/1.fa");
1012
1013 // Expected state: alignment has been opened and whole msa alphabet is amino
1014 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
1015 bool isAmino = GTUtilsMSAEditorSequenceArea::hasAminoAlphabet(os);
1016 CHECK_SET_ERR(isAmino, "Aligment has wrong alphabet type");
1017 }
1018
GUI_TEST_CLASS_DEFINITION(test_2140)1019 GUI_TEST_CLASS_DEFINITION(test_2140) {
1020 // 1. Use main menu {Tools->Dna assembly->convert UGENE assembly database to SAM format}
1021 // 2. Select any .fasta file instead of .ugenedb file
1022 // 3. Click "convert"
1023 // Expected state: UGENE not crashes. Error message is written to log
1024
1025 GTLogTracer l;
1026 GTUtilsDialog::waitForDialog(os, new ConvertAssemblyToSAMDialogFiller(os, dataDir + "samples/FASTA/", "human_T1.fa"));
1027 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
1028 << "NGS data analysis"
1029 << "Convert UGENE assembly database to SAM...");
1030
1031 CHECK_SET_ERR(l.hasErrors(), "Expected to have errors in the log, but no errors found");
1032 }
1033
GUI_TEST_CLASS_DEFINITION(test_2144)1034 GUI_TEST_CLASS_DEFINITION(test_2144) {
1035 // 1. Open Workflow Designer.
1036 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1037
1038 // 2. Open the NGS sample scheme "Call variants with SAM tools".
1039 GTUtilsWorkflowDesigner::addSample(os, "Call variants with SAMtools");
1040 GTKeyboardDriver::keyClick(Qt::Key_Escape);
1041
1042 // 3. Fill input data, e.g.:
1043 // "data/samples/Assembly/chrM.sam" as input to "Read Assembly SAM/BAM" element;
1044 // "data/samples/Assembly/chrM.fa" as input to "Read Sequence" element;
1045 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Assembly (BAM/SAM)"));
1046 GTMouseDriver::click();
1047 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Assembly/chrM.sam");
1048
1049 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
1050 GTMouseDriver::click();
1051 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Assembly/chrM.fa");
1052
1053 // 4. Choose "Estimate" option in tool bar.
1054 // "Estimate" option is available only for NGS samples (except "Extract transcript sequence").
1055 // Expected state: Estimation dialog appears and provides information about approximate time of workflow run.
1056 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Close, "Approximate estimation time of the workflow run is"));
1057 GTWidget::click(os, GTAction::button(os, "Estimate workflow"));
1058 }
1059
GUI_TEST_CLASS_DEFINITION(test_2150)1060 GUI_TEST_CLASS_DEFINITION(test_2150) {
1061 // 1. Open Workflow Designer.
1062 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1063 // 2. Open the "Align sequences with MUSCLE" sample scheme.
1064 GTUtilsWorkflowDesigner::addSample(os, "Align sequences with MUSCLE");
1065 GTKeyboardDriver::keyClick(Qt::Key_Escape);
1066
1067 // 3. Set "data/samples/CLUSTALW/ty3.aln.gz" as the input file.
1068 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read alignment"));
1069 GTMouseDriver::click();
1070 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/CLUSTALW/ty3.aln.gz");
1071 GTGlobals::sleep();
1072
1073 // 4. Set some name to the result file.
1074 // QTableView* table = qobject_cast<QTableView*>(GTWidget::findWidget(os,"table"));
1075 // CHECK_SET_ERR(table,"tableView not found");
1076 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Write alignment"));
1077 GTMouseDriver::click();
1078 // GTMouseDriver::moveTo(GTTableView::getCellPosition(os,table,1,1));
1079 // GTMouseDriver::click();
1080 QString s = QFileInfo(testDir + "_common_data/scenarios/sandbox/").absoluteFilePath();
1081 GTKeyboardDriver::keySequence(s + "/2150_0001.sto");
1082 GTUtilsWorkflowDesigner::setParameter(os, "Output file", s + "/2150_0001.aln", GTUtilsWorkflowDesigner::textValue);
1083 GTWidget::click(os, GTUtilsMdi::activeWindow(os));
1084
1085 // 5. Run the workflow.
1086 GTWidget::click(os, GTAction::button(os, "Run workflow"));
1087 GTGlobals::sleep(5000);
1088 // GTUtilsTaskTreeView::waitTaskFinished(os,1000);
1089
1090 // 6. During the workflow execution open the "Tasks" panel in the bottom, find in the task tree the "MUSCLE alignment" subtask and cancel it.
1091 GTUtilsTask::cancelSubTask(os, "MUSCLE alignment");
1092 GTGlobals::sleep();
1093 }
1094
GUI_TEST_CLASS_DEFINITION(test_2152)1095 GUI_TEST_CLASS_DEFINITION(test_2152) {
1096 // 1. Open WD
1097 // 2. Create a scheme with the following elements: Read File URL(s), Assembly Sequences with CAP3
1098 // 3. Put _common_data/cap3/region1.fa,
1099 // _common_data/cap3/region2.fa,
1100 // _common_data/cap3/region3.fa,
1101 // _common_data/cap3/region4.fa as an input sequences
1102 // 4. Run the scheme
1103 // Expected state: the dashboard appears, the WD task has been finished without errors.
1104
1105 GTLogTracer l;
1106 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1107
1108 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read File URL(s)");
1109 GTUtilsWorkflowDesigner::addAlgorithm(os, "Assembly Sequences with CAP3");
1110
1111 WorkflowProcessItem *fileList = GTUtilsWorkflowDesigner::getWorker(os, "Read File URL(s)");
1112 WorkflowProcessItem *fileCAP3 = GTUtilsWorkflowDesigner::getWorker(os, "Assembly Sequences with CAP3");
1113
1114 GTUtilsWorkflowDesigner::connect(os, fileList, fileCAP3);
1115
1116 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Assembly Sequences with CAP3"));
1117 GTMouseDriver::click();
1118 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir().absoluteFilePath(sandBoxDir + "out.ace"), GTUtilsWorkflowDesigner::textValue);
1119
1120 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read File URL(s)"));
1121 GTMouseDriver::click();
1122 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cap3/region1.fa");
1123 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cap3/region2.fa");
1124 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cap3/region3.fa");
1125 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cap3/region4.fa");
1126
1127 GTWidget::click(os, GTAction::button(os, "Run workflow"));
1128 GTUtilsTaskTreeView::waitTaskFinished(os);
1129
1130 GTUtilsLog::check(os, l);
1131 }
1132
GUI_TEST_CLASS_DEFINITION(test_2156)1133 GUI_TEST_CLASS_DEFINITION(test_2156) {
1134 // 1. Open "data/samples/CLUSTALW/COI.aln".
1135 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
1136 GTUtilsTaskTreeView::waitTaskFinished(os);
1137 GTUtilsProjectTreeView::openView(os);
1138 GTUtilsProjectTreeView::toggleView(os);
1139 // 2. Select six symbols (45-50) of the first line.
1140 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(44, 0), QPoint(49, 0));
1141 // 3. Press BACKSPACE.
1142 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
1143 // Expected state: three gaps before the selected area are removed.
1144 GTWidget::click(os, GTUtilsMdi::activeWindow(os));
1145 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(41, 0), QPoint(44, 0));
1146 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
1147 QString clipboardText = GTClipboard::text(os);
1148 CHECK_SET_ERR(clipboardText == "CTAA", QString("Expected: CTAA, found: %1").arg(clipboardText));
1149 }
1150
GUI_TEST_CLASS_DEFINITION(test_2157)1151 GUI_TEST_CLASS_DEFINITION(test_2157) {
1152 // 1. Open file "https://ugene.net/tracker/secure/attachment/12864/pdb1a07.ent.gz".
1153 GTFileDialog::openFile(os, testDir + "_common_data/pdb/", "pdb1a07.ent.gz");
1154 GTUtilsTaskTreeView::waitTaskFinished(os);
1155
1156 // Expected state: UGENE displays sequence and 3d structure
1157 GTUtilsMdi::findWindow(os, "pdb1a07.ent.gz");
1158 }
1159
GUI_TEST_CLASS_DEFINITION(test_2160)1160 GUI_TEST_CLASS_DEFINITION(test_2160) {
1161 // 1. Open document "ma.aln"
1162 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma.aln");
1163 GTUtilsTaskTreeView::waitTaskFinished(os);
1164
1165 // 2. Select whole msa
1166 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(11, 17));
1167
1168 // 3. Shift msa
1169 const QPoint mouseDragPosition(7, 7);
1170 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition);
1171 GTMouseDriver::press();
1172 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition + QPoint(3, 0));
1173 GTMouseDriver::release();
1174 GTThread::waitForMainThread();
1175
1176 // 4. Press "Delete" key
1177 GTKeyboardDriver::keyClick(Qt::Key_Delete);
1178
1179 // 6. Check that alignment has not changed
1180 CHECK_SET_ERR(15 == GTUtilsMSAEditorSequenceArea::getLength(os),
1181 "MSA length unexpectedly changed");
1182 CHECK_SET_ERR(18 == GTUtilsMSAEditorSequenceArea::getNameList(os).size(),
1183 "MSA row count unexpectedly changed");
1184 }
1185
GUI_TEST_CLASS_DEFINITION(test_2165)1186 GUI_TEST_CLASS_DEFINITION(test_2165) {
1187 // 1. Open human_t1
1188 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
1189 GTUtilsTaskTreeView::waitTaskFinished(os);
1190
1191 // 2. Copy the whole sequence to the clipboard
1192 GTWidget::click(os, GTUtilsSequenceView::getPanOrDetView(os));
1193 GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os));
1194 GTWidget::click(os, GTWidget::findWidget(os, "select_range_action"));
1195 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
1196
1197 // 3. Past the whole sequence to the find pattern field
1198 GTWidget::click(os, GTWidget::findWidget(os, "OP_FIND_PATTERN"));
1199 GTWidget::click(os, GTWidget::findWidget(os, "textPattern"));
1200 GTKeyboardDriver::keyClick('v', Qt::ControlModifier);
1201
1202 GTUtilsNotifications::checkNotificationDialogText(os, "too long");
1203 }
1204
GUI_TEST_CLASS_DEFINITION(test_2188)1205 GUI_TEST_CLASS_DEFINITION(test_2188) {
1206 class Helper {
1207 public:
1208 Helper(const QString &dataDir, const QString &testDir, HI::GUITestOpStatus &os) {
1209 dir = testDir + "_common_data/scenarios/sandbox/";
1210 fileName = "regression_test_2188.fa";
1211 url = dir + fileName;
1212 bool copied = QFile::copy(dataDir + "samples/FASTA/human_T1.fa", url);
1213 if (!copied) {
1214 os.setError("Can not copy the file");
1215 url = "";
1216 }
1217 }
1218
1219 QString url;
1220 QString dir;
1221 QString fileName;
1222 };
1223
1224 // 1. Open the file "data/samples/FASTA/human_T1.fa"
1225 Helper helper(dataDir, testDir, os);
1226 CHECK_OP(os, );
1227 GTFileDialog::openFile(os, helper.dir, helper.fileName);
1228 GTUtilsTaskTreeView::waitTaskFinished(os);
1229 GTGlobals::sleep(500);
1230
1231 // 2. At the same time open the file with a text editor
1232 // 3. Change something and save
1233 // Expected state: Dialog suggesting file to reload has appeared in UGENE
1234 // 4. Press "Yes to All" button
1235 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Yes));
1236 QFile file(helper.url);
1237 bool opened = file.open(QIODevice::Append);
1238 CHECK_SET_ERR(opened, "Can not open the file for writing");
1239 qint64 writed = file.write("AAAAAAAAAA");
1240 CHECK_SET_ERR(10 == writed, "Can not write to the file");
1241 file.close();
1242 GTGlobals::sleep(6000);
1243
1244 // Expected state: All the sequences were reloaded and displayed correctly in sequence view
1245 int length = GTUtilsSequenceView::getLengthOfSequence(os);
1246 CHECK_OP(os, );
1247 CHECK_SET_ERR(199960 == length, "The file lenght is wrong");
1248 }
1249
GUI_TEST_CLASS_DEFINITION(test_2187)1250 GUI_TEST_CLASS_DEFINITION(test_2187) {
1251 // 1. Open "data/samples/FASTA/human_T1.fa"
1252 // d:\src\ugene\trunk\test\_common_data\scenarios\_regression\2187\seq.fa
1253
1254 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/2187/", "seq.fa");
1255 GTUtilsTaskTreeView::waitTaskFinished(os);
1256 GTUtilsDocument::checkDocument(os, "seq.fa");
1257
1258 // 2. Open {Actions -> Analyze -> Find tandems...}
1259 // 3. Click ok
1260
1261 Runnable *tDialog = new FindTandemsDialogFiller(os, testDir + "_common_data/scenarios/sandbox/result_2187.gb");
1262 GTUtilsDialog::waitForDialog(os, tDialog);
1263
1264 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
1265 << "Analyze"
1266 << "Find tandem repeats...",
1267 GTGlobals::UseMouse);
1268 GTUtilsTaskTreeView::waitTaskFinished(os);
1269
1270 GTUtilsAnnotationsTreeView::getTreeWidget(os);
1271 QTreeWidgetItem *annotationsRoot = GTUtilsAnnotationsTreeView::findItem(os, "repeat_unit (0, 5)");
1272 GTMouseDriver::moveTo(GTTreeWidget::getItemCenter(os, annotationsRoot->child(0)));
1273 GTMouseDriver::doubleClick();
1274
1275 Runnable *filler = new EditAnnotationChecker(os, "repeat_unit", "251..251,252..252,253..253,254..254,255..255,256..256,257..257,258..258,259..259");
1276 GTUtilsDialog::waitForDialog(os, filler);
1277 static QList<QTreeWidgetItem *> items = GTUtilsAnnotationsTreeView::findItems(os, "repeat_unit");
1278 foreach (QTreeWidgetItem *item, items) {
1279 if (item->text(2) == "251..251,252..252,253..253,254..254,255..255,256..256,257..257,258..258,259..259") {
1280 CHECK_SET_ERR("9" == GTUtilsAnnotationsTreeView::getQualifierValue(os, "num_of_repeats", item), "Wrong num_of_repeats value");
1281 CHECK_SET_ERR("1" == GTUtilsAnnotationsTreeView::getQualifierValue(os, "repeat_length", item), "Wrong repeat_length value");
1282 CHECK_SET_ERR("9" == GTUtilsAnnotationsTreeView::getQualifierValue(os, "whole_length", item), "Wrong whole_length value");
1283 break;
1284 }
1285 }
1286
1287 GTKeyboardDriver::keyClick(Qt::Key_F2);
1288
1289 GTUtilsMdi::click(os, GTGlobals::Close);
1290 GTMouseDriver::click();
1291 }
1292
GUI_TEST_CLASS_DEFINITION(test_2192)1293 GUI_TEST_CLASS_DEFINITION(test_2192) {
1294 QString samtoolsPath = "samtools/samtools";
1295 #ifdef Q_OS_WIN
1296 samtoolsPath = "samtools\\samtools";
1297 #endif
1298 // 1. Open WD.
1299 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1300 // 2. Open Call Variants sample.
1301 GTUtilsWorkflowDesigner::addSample(os, "call variants");
1302 GTKeyboardDriver::keyClick(Qt::Key_Escape);
1303 // 3. Set valid input data.
1304 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Assembly (BAM/SAM)"));
1305 GTMouseDriver::click();
1306 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/bam/chrM.sorted.bam");
1307
1308 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
1309 GTMouseDriver::click();
1310 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cmdline/call-variations/chrM.fa");
1311 // 4. Start the scheme.
1312 GTUtilsWorkflowDesigner::runWorkflow(os);
1313 GTUtilsTaskTreeView::waitTaskFinished(os);
1314 // 5. Open External Tools tab & copy sam tools path
1315 GTUtilsDashboard::openTab(os, GTUtilsDashboard::ExternalTools);
1316 QWidget *samToolsRunNode = GTUtilsDashboard::getCopyButton(os, "actor_call_variants_run_1_tool_SAMtools_run_1");
1317 GTWidget::click(os, samToolsRunNode);
1318
1319 QString text = GTClipboard::text(os);
1320 CHECK_SET_ERR(text.contains(samtoolsPath), "Unexpected SAMTools path:\n" + text);
1321 }
1322
GUI_TEST_CLASS_DEFINITION(test_2202)1323 GUI_TEST_CLASS_DEFINITION(test_2202) {
1324 // 1. Open Workflow Designer first time (e.g. remove UGENE.ini before it).
1325 // Expected: the dialog appears.
1326
1327 // 2. Write the path to the folder which does not exist.
1328
1329 // 3. Click OK.
1330 // Expected: the folder is created, there are no error messages about write access.
1331
1332 QDir workflowOutputDir(testDir + "_common_data/scenarios/sandbox/regression_test_2202/1/2/3/4/");
1333 CHECK_SET_ERR(!workflowOutputDir.exists(), "Dir already exists");
1334
1335 GTUtilsDialog::waitForDialog(os, new StartupDialogFiller(os, workflowOutputDir.absolutePath()));
1336 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
1337 << "Workflow Designer...");
1338
1339 CHECK_SET_ERR(workflowOutputDir.exists(), "Dir wasn't created");
1340 }
1341
GUI_TEST_CLASS_DEFINITION(test_2204)1342 GUI_TEST_CLASS_DEFINITION(test_2204) {
1343 // 1. Go to the WD samples. Double click on the Chip-Seq WD sample.
1344 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1345 // Expexted: setup dialog appears.
1346 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Cistrome Workflow", QStringList() << "Only treatment tags"));
1347
1348 class customWizard : public CustomScenario {
1349 public:
1350 void run(HI::GUITestOpStatus &os) {
1351 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1352 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
1353 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
1354 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
1355 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
1356 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
1357
1358 QComboBox *combo = GTWidget::findExactWidget<QComboBox *>(os, "Motif database widget", dialog);
1359 GTComboBox::checkValues(os, combo, QStringList() /*<<"cistrome.xml"*/ << "hpdi.xml"
1360 << "jaspar.xml");
1361 QString s = combo->currentText();
1362 CHECK_SET_ERR(s == "hpdi.xml,jaspar.xml", "unexpected text: " + s);
1363
1364 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
1365 dialog = QApplication::activeModalWidget();
1366 if (dialog != nullptr) {
1367 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
1368 }
1369 }
1370 };
1371 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "ChIP-seq Analysis Wizard", new customWizard));
1372 GTUtilsWorkflowDesigner::addSample(os, "Cistrome");
1373 // 2. Press the setup button.
1374 // Expexted: the sample opens and the first wizard page appears.
1375 // 4. Go to the fifth wizard page by the next button.
1376 // 5. Change the Motif database parameter: uncheck cistrome.xml and check the hpdi.xml, jaspar.xml
1377 // Expected: combobox shows "hpdi.xml,jaspar.xml"
1378 }
1379
GUI_TEST_CLASS_DEFINITION(test_2225)1380 GUI_TEST_CLASS_DEFINITION(test_2225) {
1381 GTUtilsDialog::waitForDialog(os, new NCBISearchDialogSimpleFiller(os, "rat", true));
1382 GTMenu::clickMainMenuItem(os, QStringList() << "File"
1383 << "Search NCBI GenBank...",
1384 GTGlobals::UseKey);
1385 }
1386
GUI_TEST_CLASS_DEFINITION(test_2259)1387 GUI_TEST_CLASS_DEFINITION(test_2259) {
1388 MainWindow *mw = AppContext::getMainWindow();
1389 CHECK_SET_ERR(mw != nullptr, "MainWindow is NULL");
1390 QMainWindow *mainWindow = mw->getQMainWindow();
1391 CHECK_SET_ERR(mainWindow != nullptr, "QMainWindow is NULL");
1392
1393 QAction *menu = mainWindow->findChild<QAction *>(MWMENU_SETTINGS);
1394 CHECK_SET_ERR(menu->menu()->actions().size() == 2, "wrong number of actions");
1395 }
1396
GUI_TEST_CLASS_DEFINITION(test_2266_1)1397 GUI_TEST_CLASS_DEFINITION(test_2266_1) {
1398 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1399
1400 GTUtilsWorkflowDesigner::addSample(os, "call variants");
1401 GTKeyboardDriver::keyClick(Qt::Key_Escape);
1402
1403 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Assembly (BAM/SAM)"));
1404 GTMouseDriver::click();
1405 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/ugenedb/Klebsislla.sort.bam.ugenedb");
1406
1407 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
1408 GTMouseDriver::click();
1409 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/ugenedb/Klebsislla_ref.fa");
1410
1411 GTUtilsWorkflowDesigner::click(os, "Call Variants");
1412 GTUtilsWorkflowDesigner::setParameter(os, "Output variants file", QDir(sandBoxDir).absolutePath() + "/test_2266_1.vcf", GTUtilsWorkflowDesigner::lineEditWithFileSelector);
1413
1414 GTWidget::click(os, GTAction::button(os, "Run workflow"));
1415
1416 GTUtilsTaskTreeView::waitTaskFinished(os, 6000000);
1417
1418 GTFileDialog::openFile(os, sandBoxDir + "test_2266_1.vcf");
1419 GTUtilsTaskTreeView::waitTaskFinished(os);
1420
1421 GTUtilsProjectTreeView::findIndex(os, "pkF70");
1422 GTUtilsProjectTreeView::findIndex(os, "pkf140");
1423 }
GUI_TEST_CLASS_DEFINITION(test_2267_1)1424 GUI_TEST_CLASS_DEFINITION(test_2267_1) {
1425 // 1. Open human_T1.fa
1426 //
1427 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
1428 GTUtilsTaskTreeView::waitTaskFinished(os);
1429
1430 // 2. Select random subsequence, press Ctrl+N, press Enter
1431 //
1432 GTUtilsDialog::waitForDialog(os, new CreateAnnotationWidgetFiller(os, true, "DDD", "D", "10..16"));
1433 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
1434 << "Add"
1435 << "New annotation...");
1436 // 3. Press Insert, press '1' key until there is no new symbols in lineedit
1437 // Current state: no error message for long qualifier
1438 Runnable *filler = new EditQualifierFiller(os, "111111111111111111111111111111111111111111111111111111111111111111111111111111111", "val", true, false);
1439 GTUtilsDialog::waitForDialog(os, filler);
1440
1441 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_ADD << "add_qualifier_action"));
1442 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "D"));
1443 GTMouseDriver::click(Qt::RightButton);
1444
1445 // 4. Press Enter
1446 // Expected state: Edit qualifier window closes
1447 }
1448
GUI_TEST_CLASS_DEFINITION(test_2267_2)1449 GUI_TEST_CLASS_DEFINITION(test_2267_2) {
1450 // 1. Open human_T1.fa
1451 //
1452 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
1453 GTUtilsTaskTreeView::waitTaskFinished(os);
1454 // 2. Select random subsequence, press Ctrl+N, press Enter
1455 //
1456 GTUtilsDialog::waitForDialog(os, new CreateAnnotationWidgetFiller(os, true, "DDD", "D", "10..16"));
1457 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
1458 << "Add"
1459 << "New annotation...");
1460 // 3. Press Insert, set the name of qualifier: '))()((_'
1461 //
1462 // 4. Press Enter
1463 // Expected state: Error message appears once
1464 Runnable *filler = new EditQualifierFiller(os, "))()((_", "val", true, true);
1465 GTUtilsDialog::waitForDialog(os, filler);
1466
1467 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_ADD << "add_qualifier_action"));
1468 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "D"));
1469 GTMouseDriver::click(Qt::RightButton);
1470 }
1471
GUI_TEST_CLASS_DEFINITION(test_2268)1472 GUI_TEST_CLASS_DEFINITION(test_2268) {
1473 // 0. Copy t-coffee tool to the place where UGENE has enough permissions to change file permissions;
1474 // Set the copied t-coffee tool in preferences.
1475
1476 ExternalToolRegistry *etRegistry = AppContext::getExternalToolRegistry();
1477 CHECK_SET_ERR(etRegistry, "External tool registry is NULL");
1478
1479 ExternalTool *tCoffee = etRegistry->getById("USUPP_T_COFFEE");
1480 CHECK_SET_ERR(tCoffee, "T-coffee tool is NULL");
1481
1482 const QFileInfo origToolPath(tCoffee->getPath());
1483 CHECK_SET_ERR(origToolPath.exists(), "T-coffee tool is not set");
1484
1485 QDir origToolDir = origToolPath.dir();
1486 #ifdef Q_OS_LINUX
1487 origToolDir.cdUp(); // exit from 'bin' folder
1488 #endif
1489
1490 QString newToolDir = sandBoxDir + GTUtils::genUniqueString("test_2268") + "/";
1491 GTFile::copyDir(os, origToolDir.absolutePath(), newToolDir);
1492 #ifdef Q_OS_LINUX
1493 const QFileInfo newToolPath(newToolDir + "bin/t_coffee");
1494 #elif defined(Q_OS_WIN)
1495 const QFileInfo newToolPath(newToolDir + "t_coffee.bat");
1496 #else
1497 const QFileInfo newToolPath(newToolDir + "t_coffee");
1498 #endif
1499
1500 // Hack, it is better to set the tool path via the preferences dialog
1501 CHECK_SET_ERR(newToolPath.exists(), "The copied T-coffee tool does not exist");
1502 tCoffee->setPath(newToolPath.absoluteFilePath());
1503
1504 // 1. Forbid write access to the t-coffee folder recursively (chmod 555 -R %t-coffee-dir%).
1505 GTFile::setReadOnly(os, newToolDir, true);
1506
1507 // 2. Open "_common_data/clustal/align.aln".
1508 GTFileDialog::openFile(os, testDir + "_common_data/clustal/align.aln");
1509 GTUtilsTaskTreeView::waitTaskFinished(os);
1510
1511 // 3. Right click on the MSA -> Align -> Align with T-Coffee.
1512 // 4. Click the "Align" button.
1513 GTLogTracer lt;
1514 GTUtilsDialog::waitForDialog(os, new TCoffeeDailogFiller(os));
1515 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with T-Coffee"));
1516 GTMenu::showContextMenu(os, GTUtilsMdi::activeWindow(os));
1517
1518 // Expected: the t-coffee task started and finished well.
1519 GTUtilsTaskTreeView::waitTaskFinished(os);
1520 GTUtilsLog::check(os, lt);
1521 }
1522
GUI_TEST_CLASS_DEFINITION(test_2314)1523 GUI_TEST_CLASS_DEFINITION(test_2314) {
1524 // 1. Open 'COI.aln'
1525 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW", "COI.aln");
1526 GTUtilsTaskTreeView::waitTaskFinished(os);
1527
1528 // 2. Scroll sequence area to the last columns
1529 GTUtilsDialog::waitForDialog(os, new GoToDialogFiller(os, 604));
1530 GTKeyboardDriver::keyClick('g', Qt::ControlModifier);
1531
1532 // 3. Select to the whole last column by clicking consensus area.
1533 QWidget *consArea = GTWidget::findWidget(os, "consArea");
1534 GTWidget::click(os, consArea, Qt::LeftButton, QPoint(consArea->geometry().right() - 1, consArea->geometry().height() / 2));
1535
1536 // 3.1 Move the selected column with a mouse to the right. Do not click -> it will reset the selection.
1537 GTUtilsMSAEditorSequenceArea::moveMouseToPosition(os, QPoint(603, 0));
1538 QPoint p = GTMouseDriver::getMousePosition();
1539 GTMouseDriver::press();
1540 GTMouseDriver::moveTo(QPoint(p.x() + 30, p.y()));
1541 GTMouseDriver::release();
1542
1543 // Expected state: the column was moved
1544 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::getLength(os) > 604, "The length of the alignment is not changed");
1545
1546 GTUtilsMsaEditor::undo(os);
1547
1548 // 4. Move to the right 1 base region, that is close to the end of alignment
1549 GTUtilsMSAEditorSequenceArea::clickToPosition(os, QPoint(600, 5));
1550 p = GTMouseDriver::getMousePosition();
1551 GTMouseDriver::press();
1552 GTMouseDriver::moveTo(QPoint(p.x() + 30, p.y()));
1553 GTMouseDriver::release();
1554
1555 // Expected state: the region is moved if mouse goes beyond the right border of the alignment
1556 CHECK_SET_ERR(GTUtilsMSAEditorSequenceArea::getLength(os) > 604, "The length of the alignment is not changed");
1557 }
1558
GUI_TEST_CLASS_DEFINITION(test_2316)1559 GUI_TEST_CLASS_DEFINITION(test_2316) {
1560 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new StartupDialogFiller(os));
1561 GTFileDialog::openFile(os, dataDir + "samples/../workflow_samples/Alignment", "basic_align.uwl");
1562 GTUtilsTaskTreeView::waitTaskFinished(os);
1563
1564 CHECK_SET_ERR(!GTUtilsProjectTreeView::isVisible(os), "Project tree view is visible");
1565
1566 // 1. Start UGENE
1567 //
1568 // 2. Drag an .uwl file inside UGENE to open a workflow
1569 // Expected state: now the project view is collapsed if a file.uwl is drag'n'dropped to UGENE when there is no project yet.
1570 }
GUI_TEST_CLASS_DEFINITION(test_2269)1571 GUI_TEST_CLASS_DEFINITION(test_2269) {
1572 // 1. Use main menu: {tools->Align short reeds}
1573 // 2. Select Bowtie2 as a mapping tool
1574 // 3. Try to set incorrect value in "Seed lingth" spinbox(Correct boundaries are: >3, <32)
1575 AlignShortReadsFiller::Bowtie2Parameters parameters(testDir + "_common_data/scenarios/_regression/1093/",
1576 "refrence.fa",
1577 testDir + "_common_data/scenarios/_regression/1093/",
1578 "read.fa");
1579 parameters.seedLengthCheckBox = true;
1580 parameters.seedLength = 33;
1581
1582 class Scenario_test_2269 : public CustomScenario {
1583 public:
1584 virtual void run(HI::GUITestOpStatus &os) {
1585 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1586 QComboBox *methodNamesBox = GTWidget::findExactWidget<QComboBox *>(os, "methodNamesBox", dialog);
1587 GTComboBox::selectItemByText(os, methodNamesBox, "Bowtie2");
1588
1589 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/scenarios/_regression/1093/refrence.fa"));
1590 QWidget *addRefButton = GTWidget::findWidget(os, "addRefButton", dialog);
1591 GTWidget::click(os, addRefButton);
1592
1593 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/scenarios/_regression/1093/read.fa"));
1594 QWidget *addShortreadsButton = GTWidget::findWidget(os, "addShortreadsButton", dialog);
1595 GTWidget::click(os, addShortreadsButton);
1596
1597 QCheckBox *seedCheckBox = GTWidget::findExactWidget<QCheckBox *>(os, "seedlenCheckBox", dialog);
1598 GTCheckBox::setChecked(os, seedCheckBox, true);
1599
1600 QSpinBox *seedSpinBox = GTWidget::findExactWidget<QSpinBox *>(os, "seedlenSpinBox", dialog);
1601 int max = seedSpinBox->maximum();
1602 CHECK_SET_ERR(max == 31, QString("wrong seed maximim: %1").arg(max));
1603
1604 GTUtilsDialog::clickButtonBox(os, QDialogButtonBox::Cancel);
1605 }
1606 };
1607
1608 GTUtilsDialog::waitForDialog(os, new AlignShortReadsFiller(os, new Scenario_test_2269()));
1609 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
1610 << "NGS data analysis"
1611 << "Map reads to reference...");
1612
1613 CHECK_SET_ERR(!os.hasError(), "Uncorrect value is available");
1614 }
1615
GUI_TEST_CLASS_DEFINITION(test_2270)1616 GUI_TEST_CLASS_DEFINITION(test_2270) {
1617 // 1. Open file "data/cmdline/snp.uwl"
1618 // Ecpected state: scheme opened in WD without problems
1619 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new StartupDialogFiller(os));
1620 GTLogTracer lt;
1621 GTFileDialog::openFile(os, dataDir + "cmdline/", "snp.uwl");
1622 GTUtilsTaskTreeView::waitTaskFinished(os);
1623 GTUtilsLog::check(os, lt);
1624 }
1625
GUI_TEST_CLASS_DEFINITION(test_2281)1626 GUI_TEST_CLASS_DEFINITION(test_2281) {
1627 // 1. Open WD
1628 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1629 QTabWidget *tabs = qobject_cast<QTabWidget *>(GTWidget::findWidget(os, "tabs"));
1630 CHECK_SET_ERR(tabs != nullptr, "tabs widget not found");
1631
1632 // 2. Click the "samples" bar. The samples hint is shown
1633 GTTabWidget::setCurrentIndex(os, tabs, 1);
1634 QGraphicsView *sceneView = qobject_cast<QGraphicsView *>(GTWidget::findWidget(os, "sceneView"));
1635
1636 QImage img = GTWidget::getImage(os, sceneView);
1637
1638 const QColor yc = QColor(255, 255, 160);
1639 bool found = false;
1640 for (int i = sceneView->rect().left(); i < sceneView->rect().right(); i += 10) {
1641 for (int j = sceneView->rect().top(); j < sceneView->rect().bottom(); j += 10) {
1642 const QRgb rgb = img.pixel(QPoint(i, j));
1643 const QColor c(rgb);
1644 if (c == yc) {
1645 found = true;
1646 break;
1647 }
1648 }
1649 }
1650 CHECK_SET_ERR(found, "hint not found");
1651
1652 // 3. Click the "elements" bar.
1653 GTTabWidget::setCurrentIndex(os, tabs, 0);
1654
1655 // Expected: the samples hint is hidden
1656 img = GTWidget::getImage(os, sceneView);
1657 bool notFound = true;
1658 for (int i = sceneView->rect().left(); i < sceneView->rect().right(); i += 10) {
1659 for (int j = sceneView->rect().top(); j < sceneView->rect().bottom(); j += 10) {
1660 const QRgb rgb = img.pixel(QPoint(i, j));
1661 const QColor c(rgb);
1662 if (c == yc) {
1663 notFound = false;
1664 break;
1665 }
1666 }
1667 }
1668
1669 CHECK_SET_ERR(notFound, "hint is found");
1670 }
1671
GUI_TEST_CLASS_DEFINITION(test_2292)1672 GUI_TEST_CLASS_DEFINITION(test_2292) {
1673 QString destName = testDir + "_common_data/ugenedb/example-alignment.ugenedb";
1674 GTFileDialog::openFile(os, testDir + "_common_data/ugenedb/", "example-alignment.ugenedb");
1675 GTUtilsTaskTreeView::waitTaskFinished(os);
1676
1677 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, sandBoxDir + "test_2292.ace.ugenedb"));
1678 GTUtilsProject::openFile(os, dataDir + "samples/ACE/K26.ace");
1679 GTUtilsTaskTreeView::waitTaskFinished(os);
1680
1681 GTKeyboardDriver::keyClick(Qt::Key_Escape);
1682 }
1683
GUI_TEST_CLASS_DEFINITION(test_2295)1684 GUI_TEST_CLASS_DEFINITION(test_2295) {
1685 // 1. Open samples/APR/DNA.apr in read-only mode
1686 GTUtilsDialog::waitForDialog(os, new ImportAPRFileFiller(os, true));
1687 GTUtilsProject::openFile(os, dataDir + "samples/APR/DNA.apr");
1688 GTUtilsTaskTreeView::waitTaskFinished(os);
1689
1690 // Expected: Alignent is locked
1691 bool isLocked = GTUtilsMSAEditorSequenceArea::isAlignmentLocked(os);
1692 CHECK_SET_ERR(isLocked, "Alignment is unexpectably unlocked");
1693
1694 // 2. Export alignment to read-write format
1695 GTUtilsDialog::waitForDialog(os, new ExportMSA2MSADialogFiller(os, 0, sandBoxDir + "DNA"));
1696 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ACTION_PROJECT__EXPORT_IMPORT_MENU_ACTION << ACTION_PROJECT__EXPORT_TO_AMINO_ACTION));
1697 GTUtilsProjectTreeView::callContextMenu(os, "DNA.apr");
1698
1699 // Expected: Alignent is locked
1700 isLocked = GTUtilsMSAEditorSequenceArea::isAlignmentLocked(os);
1701 CHECK_SET_ERR(!isLocked, "Alignment is unexpectably locked");
1702 }
1703
GUI_TEST_CLASS_DEFINITION(test_2298)1704 GUI_TEST_CLASS_DEFINITION(test_2298) {
1705 // 1. Open the file "data/samples/CLUSTALW/COI.aln"
1706 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW", "COI.aln");
1707 GTUtilsTaskTreeView::waitTaskFinished(os);
1708
1709 // 2. Build and show a tree
1710 GTUtilsDialog::waitForDialog(os, new BuildTreeDialogFiller(os, testDir + "_common_data/scenarios/sandbox/2298.nwk", 0, 0, true));
1711 GTWidget::click(os, GTAction::button(os, "Build Tree"));
1712 GTUtilsTaskTreeView::waitTaskFinished(os);
1713
1714 // 3. Collapse any node in the tree
1715 QGraphicsItem *node = GTUtilsPhyTree::getNodes(os).at(1);
1716 QGraphicsView *treeView = qobject_cast<QGraphicsView *>(GTWidget::findWidget(os, "treeView"));
1717 treeView->ensureVisible(node);
1718 GTThread::waitForMainThread();
1719 GTMouseDriver::moveTo(GTUtilsPhyTree::getGlobalCenterCoord(os, node));
1720 GTMouseDriver::doubleClick();
1721
1722 // Expected state: the appropriate sequences in the msa view were collapsed into a group as well
1723 QStringList l = GTUtilsMSAEditorSequenceArea::getVisibleNames(os);
1724 int num = l.count();
1725 CHECK_SET_ERR(num == 3, QString("Unexpected visible sequences count. Expected: 3, actual: %1").arg(num));
1726 }
1727
GUI_TEST_CLASS_DEFINITION(test_2293)1728 GUI_TEST_CLASS_DEFINITION(test_2293) {
1729 // 0. Ensure that Bowtie2 Build index tool is not set. Remove it, if it is.
1730 // 1. Do {main menu -> Tools -> ALign to reference -> Build index}.
1731 // Expected state: a "Build index" dialog appeared.
1732 // 2. Fill the dialog:
1733 // {Align short reads method}: Bowtie2
1734 // {Reference sequence}: data/samples/FASTA/human_T1.fa
1735 // {Index file name}: set any valid data or use default
1736 // Click a "Start" button.
1737
1738 // Expected state: a message box appeared: an offer to set "Bowtie2 Build index" tool in UGENE preferences.
1739 GTUtilsExternalTools::removeTool(os, "Bowtie 2 build indexer");
1740
1741 class CheckBowtie2Filler : public Filler {
1742 public:
1743 CheckBowtie2Filler(HI::GUITestOpStatus &os)
1744 : Filler(os, "BuildIndexFromRefDialog") {
1745 }
1746 virtual void run() {
1747 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1748 QComboBox *methodNamesBox = dialog->findChild<QComboBox *>("methodNamesBox");
1749 for (int i = 0; i < methodNamesBox->count(); i++) {
1750 if (methodNamesBox->itemText(i) == "Bowtie2") {
1751 GTComboBox::selectItemByIndex(os, methodNamesBox, i);
1752 }
1753 }
1754
1755 GTFileDialogUtils *ob = new GTFileDialogUtils(os, dataDir + "samples/FASTA/", "human_T1.fa");
1756 GTUtilsDialog::waitForDialog(os, ob);
1757 GTWidget::click(os, GTWidget::findWidget(os, "addRefButton", dialog));
1758
1759 QDialogButtonBox *box = qobject_cast<QDialogButtonBox *>(GTWidget::findWidget(os, "buttonBox", dialog));
1760 CHECK_SET_ERR(box != nullptr, "buttonBox is NULL");
1761
1762 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "No"));
1763 QPushButton *okButton = box->button(QDialogButtonBox::Ok);
1764 CHECK_SET_ERR(okButton != nullptr, "ok button is NULL");
1765 GTWidget::click(os, okButton);
1766
1767 QPushButton *cancelButton = box->button(QDialogButtonBox::Cancel);
1768 CHECK_SET_ERR(cancelButton != nullptr, "Cancel button is NULL");
1769 GTWidget::click(os, cancelButton);
1770 }
1771 };
1772
1773 GTUtilsDialog::waitForDialog(os, new CheckBowtie2Filler(os));
1774 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
1775 << "NGS data analysis"
1776 << "Build index for reads mapping...");
1777 }
1778
GUI_TEST_CLASS_DEFINITION(test_2282)1779 GUI_TEST_CLASS_DEFINITION(test_2282) {
1780 // 1. Open "chrM.sorted.bam" file using {File->Open} menu in UGENE.
1781 // Expected state: "Import BAM file" dialog has appeared.
1782 // 2. Press "Enter".
1783 // Expected state:
1784 // 1) The dialog has been closed.
1785 // 2) A new project has been created.
1786 QString assFileName = testDir + "_common_data/scenarios/sandbox/test_2282.chrM.sorted.ugenedb";
1787 QString assDocName = "test_2282.chrM.sorted.ugenedb";
1788 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, assFileName));
1789 GTFileDialog::openFile(os, testDir + "_common_data/bam", "chrM.sorted.bam");
1790 GTUtilsTaskTreeView::waitTaskFinished(os);
1791 GTUtilsTaskTreeView::waitTaskFinished(os);
1792
1793 // 3) The Project View with document "chrM.sorted.bam.ugenedb" has been opened.
1794 GTUtilsProjectTreeView::findIndex(os, assDocName);
1795
1796 GTUtilsMdi::closeWindow(os, GTUtilsMdi::activeWindowTitle(os));
1797 GTGlobals::sleep(100);
1798
1799 // 3. Delete "chrM.sorted.bam.ugenedb" from the file system (i.e. not from UGENE).
1800 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
1801 bool deleteResult = QFile::remove(QFileInfo(assFileName).absoluteFilePath());
1802 CHECK_SET_ERR(deleteResult, "Unable to remove assembly file");
1803 GTGlobals::sleep(5000);
1804 }
1805
GUI_TEST_CLASS_DEFINITION(test_2284)1806 GUI_TEST_CLASS_DEFINITION(test_2284) {
1807 // 1. Open COI.aln
1808 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
1809 GTUtilsTaskTreeView::waitTaskFinished(os);
1810
1811 // 2. Press the "Switch on/off collapsing" button
1812 GTUtilsMsaEditor::toggleCollapsingMode(os);
1813
1814 // expected state: Mecopoda_elongata__Ishigaki__J and Mecopoda_elongata__Sumatra_ are collapsed
1815 CHECK_SET_ERR(!GTUtilsMSAEditorSequenceArea::isSequenceVisible(os, QString("Mecopoda_elongata__Sumatra_")),
1816 "Required sequence is not collapsed");
1817
1818 // 3. Select the first base in last row
1819 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 16), QPoint(0, 16));
1820
1821 // 4. In status bar search field type "AATT"
1822 GTKeyboardDriver::keyClick('f', Qt::ControlModifier);
1823 GTKeyboardDriver::keySequence("AATT");
1824
1825 // 5. Press the "Find forward" button a few times until selection reaches the end of the alignment
1826 // 6. Press the button again
1827 for (int i = 0; i < 11; i++) {
1828 GTKeyboardDriver::keyClick(Qt::Key_Enter);
1829 }
1830 }
1831
GUI_TEST_CLASS_DEFINITION(test_2285)1832 GUI_TEST_CLASS_DEFINITION(test_2285) {
1833 // 1. Open {data/samples/CLUSTALW/COI.aln}
1834 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW", "COI.aln");
1835 GTUtilsTaskTreeView::waitTaskFinished(os);
1836
1837 // 2. Click the "Switch on/off collapsing" button on the toolbar.
1838 GTUtilsMsaEditor::toggleCollapsingMode(os);
1839 // Expected state: Collapsed mode is switched on, there are one collapsed group.
1840 int visableNamesNum = GTUtilsMSAEditorSequenceArea::getVisibleNames(os).count();
1841 CHECK_SET_ERR(visableNamesNum == 17,
1842 QString("unexpected visable sequences number. Expected 17, actual: %1").arg(visableNamesNum));
1843 // 3. Expand the collapsed group ("Mecopoda_elongata__Ishigaki__J" is the head sequence).
1844 GTUtilsMSAEditorSequenceArea::clickCollapseTriangle(os, "Mecopoda_elongata__Ishigaki__J");
1845
1846 // 4. Set the cursor to the 14 line (the "Mecopoda_elongata__Ishigaki__J" sequence), 45 base.
1847
1848 QWidget *documentTreeWidget = GTWidget::findWidget(os, GTUtilsProjectTreeView::widgetName, nullptr, GTGlobals::FindOptions(false));
1849 if (documentTreeWidget != nullptr) {
1850 GTUtilsProjectTreeView::toggleView(os);
1851 }
1852 GTUtilsMSAEditorSequenceArea::click(os, QPoint(44, 13));
1853 // 5. Press Backspace.
1854 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
1855
1856 // Expected state: each sequence in the group loose one gap.
1857 GTUtilsMSAEditorSequenceArea::click(os);
1858 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(43, 13), QPoint(43, 14));
1859 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
1860 QString clipboardText = GTClipboard::text(os);
1861
1862 CHECK_SET_ERR(clipboardText == "T\n-", "Unexpected selection. Expected: T\nT, actual: " + clipboardText);
1863 }
1864
GUI_TEST_CLASS_DEFINITION(test_2306)1865 GUI_TEST_CLASS_DEFINITION(test_2306) {
1866 // 1. Open file "data/samples/CLUSTALW/COI.aln"
1867 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
1868 GTUtilsTaskTreeView::waitTaskFinished(os);
1869
1870 // 2. Turn on collapsing mode in MSA
1871 GTUtilsMsaEditor::toggleCollapsingMode(os);
1872
1873 // expected state: Mecopoda_elongata__Ishigaki__J and Mecopoda_elongata__Sumatra_ are collapsed
1874 CHECK_SET_ERR(!GTUtilsMSAEditorSequenceArea::isSequenceVisible(os, QString("Mecopoda_elongata__Sumatra_")),
1875 "Required sequence is not collapsed");
1876
1877 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(5, 10), QPoint(15, 15));
1878
1879 // 3. Shift the region but don't release left mouse button
1880 const QPoint mouseDragPosition(12, 12);
1881 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition);
1882 GTMouseDriver::press();
1883 GTUtilsMSAEditorSequenceArea::moveTo(os, mouseDragPosition + QPoint(3, 0));
1884 GTMouseDriver::release();
1885 GTThread::waitForMainThread();
1886 GTKeyboardDriver::keyClick(Qt::Key_Escape);
1887 GTThread::waitForMainThread();
1888
1889 // 4. Call context menu
1890 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(5, 10), QPoint(7, 15));
1891 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
1892 const QString finalMsaContent = GTClipboard::text(os);
1893 CHECK_SET_ERR("---\n---\n---\n---\n---\n---" == finalMsaContent, "Unexpected MSA content has occurred" + finalMsaContent);
1894 }
1895
GUI_TEST_CLASS_DEFINITION(test_2309)1896 GUI_TEST_CLASS_DEFINITION(test_2309) {
1897 // 1. Open file "data/samples/CLUSTALW/COI.aln"
1898 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
1899 GTUtilsTaskTreeView::waitTaskFinished(os);
1900 GTUtilsProjectTreeView::toggleView(os); // Close project view to make all actions on toolbar available.
1901
1902 // 2. Build tree for the alignment
1903 GTUtilsDialog::waitForDialog(os, new BuildTreeDialogFiller(os, testDir + "_common_data/scenarios/sandbox/2309.nwk", 0, 0, true));
1904 GTWidget::click(os, GTAction::button(os, "Build Tree"));
1905 GTUtilsTaskTreeView::waitTaskFinished(os);
1906
1907 GTUtilsProjectTreeView::toggleView(os); // Hide project tree view to ensure that all buttons on the toolbar are visible.
1908
1909 QStringList initialNames = GTUtilsMSAEditorSequenceArea::getNameList(os);
1910
1911 GTWidget::click(os, GTAction::button(os, "Refresh tree"));
1912 GTUtilsTaskTreeView::waitTaskFinished(os);
1913
1914 QStringList newNames = GTUtilsMSAEditorSequenceArea::getNameList(os);
1915 CHECK_SET_ERR(newNames == initialNames, "Wrong sequences order");
1916 }
1917
GUI_TEST_CLASS_DEFINITION(test_2318)1918 GUI_TEST_CLASS_DEFINITION(test_2318) {
1919 class FirstItemPopupChooser : public PopupChooser {
1920 public:
1921 FirstItemPopupChooser(HI::GUITestOpStatus &os)
1922 : PopupChooser(os, QStringList()) {
1923 }
1924
1925 virtual void run() {
1926 GTMouseDriver::release();
1927 GTKeyboardDriver::keyClick(Qt::Key_Down);
1928 GTKeyboardDriver::keyClick(Qt::Key_Enter);
1929 }
1930 };
1931
1932 class PlusClicker : public FindAnnotationCollocationsDialogFiller {
1933 public:
1934 PlusClicker(HI::GUITestOpStatus &os, const QString &_annName)
1935 : FindAnnotationCollocationsDialogFiller(os),
1936 annName(_annName) {
1937 }
1938
1939 virtual void run() {
1940 QToolButton *plusButton = getPlusButton();
1941 CHECK_SET_ERR(plusButton, "First plus toolbutton is NULL");
1942 firstSize = plusButton->size();
1943
1944 GTUtilsDialog::waitForDialog(os, new FirstItemPopupChooser(os));
1945 GTWidget::click(os, plusButton);
1946
1947 plusButton = getPlusButton();
1948 CHECK_SET_ERR(plusButton, "Second plus toolbutton is NULL");
1949 secondSize = plusButton->size();
1950
1951 bool result = test();
1952 CHECK_SET_ERR(result, "Incorrect result");
1953
1954 FindAnnotationCollocationsDialogFiller::run();
1955 }
1956
1957 private:
1958 bool test() const {
1959 return firstSize == secondSize;
1960 }
1961
1962 QString annName;
1963 QSize firstSize;
1964 QSize secondSize;
1965 };
1966
1967 // 1) Open {data/samples/murine.gb}
1968 GTFileDialog::openFile(os, dataDir + "/samples/Genbank/", "murine.gb");
1969 GTUtilsTaskTreeView::waitTaskFinished(os);
1970
1971 // 2) Use context menu: {Analyze -> Find annotated regions}
1972 // 3) Click plus button, select any annotation
1973 // Expected state: plus button changes place, its size wasn't change
1974 QToolBar *toolbar = GTToolbar::getToolbar(os, "mwtoolbar_activemdi");
1975 CHECK_SET_ERR(toolbar, "Toolbar is NULL");
1976 QWidget *farButton = GTToolbar::getWidgetForActionTooltip(os, toolbar, "Find annotated regions");
1977 CHECK_SET_ERR(farButton, "Find annotated region button is NULL");
1978
1979 // Expected state is checked in PlusClicker
1980 GTUtilsDialog::waitForDialog(os, new PlusClicker(os, "CDS"));
1981 GTWidget::click(os, farButton);
1982 }
1983
GUI_TEST_CLASS_DEFINITION(test_2351)1984 GUI_TEST_CLASS_DEFINITION(test_2351) {
1985 // 1. Run UGENE
1986 // 2. Press the "New Project" button on the main toolbar
1987 // Expected state: the "Create new project" dialog has appeared
1988 // 3. Press the "Create" button or press the "Enter" key
1989 // 4. Repeat steps 2 and 3 as fast as you can more than 10 times
1990 // Expected state: UGENE does not crash
1991 class RapidProjectCreator : public Filler {
1992 public:
1993 RapidProjectCreator(HI::GUITestOpStatus &os, const QString &_projectName, const QString &_projectFolder, const QString &_projectFile)
1994 : Filler(os, "CreateNewProjectDialog"),
1995 projectName(_projectName),
1996 projectFolder(_projectFolder),
1997 projectFile(_projectFile) {
1998 }
1999
2000 virtual void run() {
2001 QWidget *dialog = GTWidget::getActiveModalWidget(os);
2002
2003 QLineEdit *projectNameEdit = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "projectNameEdit", dialog));
2004 if (nullptr == projectNameEdit) {
2005 os.setError("projectNameEdit not found");
2006 return;
2007 }
2008 projectNameEdit->setText(projectName);
2009
2010 QLineEdit *projectFileEdit = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "projectFilePathEdit", dialog));
2011 if (nullptr == projectFileEdit) {
2012 os.setError("projectFileEdit not found");
2013 return;
2014 }
2015 projectFileEdit->setText(projectFolder + "/" + projectFile);
2016
2017 QDialogButtonBox *box = qobject_cast<QDialogButtonBox *>(GTWidget::findWidget(os, "buttonBox", dialog));
2018 CHECK_SET_ERR(box != nullptr, "buttonBox is NULL");
2019 QPushButton *button = box->button(QDialogButtonBox::Ok);
2020 CHECK_SET_ERR(button != nullptr, "ok button is NULL");
2021 GTWidget::click(os, button);
2022 }
2023
2024 private:
2025 const QString projectName;
2026 const QString projectFolder;
2027 const QString projectFile;
2028 };
2029
2030 const QString projectName = "test_2351";
2031 const QString projectFolder = testDir + "_common_data/scenarios/sandbox";
2032 const QString projectFile = "test_2351";
2033
2034 for (int i = 0; i < 15; ++i) {
2035 GTUtilsDialog::waitForDialog(os, new RapidProjectCreator(os, projectName, projectFolder, projectFile));
2036 GTWidget::click(os,
2037 GTToolbar::getWidgetForActionObjectName(os,
2038 GTToolbar::getToolbar(os, MWTOOLBAR_MAIN),
2039 ACTION_PROJECTSUPPORT__NEW_PROJECT));
2040 }
2041 }
2042
GUI_TEST_CLASS_DEFINITION(test_2342)2043 GUI_TEST_CLASS_DEFINITION(test_2342) {
2044 // 1. Open WD, open Cistrome sample.
2045 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2046
2047 // 2. Select the SeqPos element on the scene. Properties of the SeqPos element are displayed the property widget.
2048 // GTUtilsDialog::waitForDialog(os, new EscapeClicker(os, "ChIP-seq Analysis Wizard"));
2049 // 3. Open wizard, go to the SeqPos page.
2050 // GTWidget::click(os, GTAction::button(os, "Show wizard"));
2051 // 4. Change any parameter value(e.g. "Motif database").
2052 // 5. Apply wizard changes.
2053 QVariantMap map;
2054 map.insert("Region width", QVariant(300));
2055 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "ChIP-seq Analysis Wizard", QList<QStringList>(), map));
2056 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Cistrome Workflow", QStringList() << "Only treatment tags"));
2057 GTUtilsWorkflowDesigner::addSample(os, "Cistrome");
2058
2059 // Expected state: element on the scene is updated, property widget is updated.
2060 GTUtilsWorkflowDesigner::click(os, "Collect Motifs with SeqPos");
2061 QString par = GTUtilsWorkflowDesigner::getParameter(os, "Region width");
2062 CHECK_SET_ERR(par == "300", "unexpected parameter: " + par);
2063 }
2064
GUI_TEST_CLASS_DEFINITION(test_2343)2065 GUI_TEST_CLASS_DEFINITION(test_2343) {
2066 // 1. Open Workflow designer
2067 // 2. Add element "Align with ClustalW"
2068 // 3. Select the element
2069 // Expected state: property widget for the element appeared
2070 // 4. Select "Gap distance" parameter in the property widget
2071 // 5. Press "Tab" key
2072 // Expected state: focus setted to "End Gaps" value
2073
2074 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2075 GTUtilsWorkflowDesigner::addAlgorithm(os, "Align with ClustalW");
2076 GTUtilsWorkflowDesigner::click(os, "Align with ClustalW");
2077
2078 GTUtilsWorkflowDesigner::clickParameter(os, "Gap distance");
2079 GTMouseDriver::doubleClick();
2080 QWidget *wgt = QApplication::focusWidget();
2081 CHECK_SET_ERR(wgt != nullptr, "No widnget in focus")
2082
2083 GTKeyboardDriver::keyClick(Qt::Key_Tab);
2084
2085 CHECK_SET_ERR(QApplication::focusWidget() != nullptr, "No widget in focus");
2086 CHECK_SET_ERR(wgt != QApplication::focusWidget(), "Focus didn't changed");
2087 }
2088
GUI_TEST_CLASS_DEFINITION(test_2344)2089 GUI_TEST_CLASS_DEFINITION(test_2344) {
2090 // 1. Open WD.
2091 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2092 // 2. Add the "ChIP-seq analysis with Cistrome tools" sample.
2093 GTUtilsDialog::waitForDialog(os, new DefaultWizardFiller(os, "ChIP-seq Analysis Wizard"));
2094 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Cistrome Workflow", QStringList() << "Only treatment tags"));
2095 GTUtilsWorkflowDesigner::addSample(os, "Cistrome");
2096 // Expected state: the sample wizard appears.
2097 // 3. Choose the "Treatment tags only" mode and click "Setup".
2098 // Expected state: the sample is added. The workflow scale is 90%. The workflow wizard appears.
2099 // 4. Exit the wizard.
2100 QComboBox *wdScaleCombo = GTWidget::findExactWidget<QComboBox *>(os, "wdScaleCombo");
2101
2102 CHECK_SET_ERR(wdScaleCombo->itemText(0) == "25%", "unexpected scale: " + wdScaleCombo->itemText(0));
2103 CHECK_SET_ERR(wdScaleCombo->itemText(1) == "50%", "unexpected scale: " + wdScaleCombo->itemText(1));
2104 CHECK_SET_ERR(wdScaleCombo->itemText(2) == "75%", "unexpected scale: " + wdScaleCombo->itemText(2));
2105 CHECK_SET_ERR(wdScaleCombo->itemText(3) == "90%", "unexpected scale: " + wdScaleCombo->itemText(3));
2106 CHECK_SET_ERR(wdScaleCombo->itemText(4) == "100%", "unexpected scale: " + wdScaleCombo->itemText(4));
2107 CHECK_SET_ERR(wdScaleCombo->itemText(5) == "125%", "unexpected scale: " + wdScaleCombo->itemText(5));
2108 CHECK_SET_ERR(wdScaleCombo->itemText(6) == "150%", "unexpected scale: " + wdScaleCombo->itemText(6));
2109 CHECK_SET_ERR(wdScaleCombo->itemText(7) == "200%", "unexpected scale: " + wdScaleCombo->itemText(7));
2110 // 5. Expand the scale combobox on the toolbar.
2111 // Expected state: values are sorted in the increasing order.
2112 }
2113
GUI_TEST_CLASS_DEFINITION(test_2352)2114 GUI_TEST_CLASS_DEFINITION(test_2352) {
2115 // 1. Close current project or open empty UGENE
2116 // 2. Open menu {Tools->Build dotplot...}
2117 // 3. Select any binary file as first file in dialog
2118 // Expected state: file is not selected, no crash
2119
2120 QString randomBinaryFile = QCoreApplication::applicationFilePath();
2121
2122 GTUtilsDialog::waitForDialog(os, new BuildDotPlotFiller(os, randomBinaryFile, randomBinaryFile, false, false, false, 5, 5, true));
2123 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
2124 GTMenu::clickMainMenuItem(os, {"Tools", "Build dotplot..."});
2125 }
2126
GUI_TEST_CLASS_DEFINITION(test_2360)2127 GUI_TEST_CLASS_DEFINITION(test_2360) {
2128 // 1. Open "data/samples/COI.aln".
2129 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
2130 GTUtilsTaskTreeView::waitTaskFinished(os);
2131
2132 // 2. Right click on document in project.
2133 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "COI.aln"));
2134
2135 // 3. Choose the context menu {Export/Import->Export nucleic alignment to amino translation}.
2136 // Expected state: Export dialog appears.
2137 // 4. Set "File format to use" to PHYLIP Sequantial.
2138 // 5. Click "Export".
2139 GTUtilsDialog::waitForDialog(os, new ExportMSA2MSADialogFiller(os, 6));
2140 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ACTION_PROJECT__EXPORT_IMPORT_MENU_ACTION << ACTION_PROJECT__EXPORT_TO_AMINO_ACTION));
2141 GTMouseDriver::click(Qt::RightButton);
2142 }
2143
GUI_TEST_CLASS_DEFINITION(test_2364)2144 GUI_TEST_CLASS_DEFINITION(test_2364) {
2145 // 1. Open WD.'
2146 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2147
2148 // 2. Create a workflow: Read sequence -> Write sequence.
2149 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
2150 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Sequence", true);
2151
2152 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence"), GTUtilsWorkflowDesigner::getWorker(os, "Write Sequence"));
2153
2154 // 3. Set the input sequence file: "data/samples/FASTA/human_T1.fa".
2155 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
2156 GTMouseDriver::click();
2157 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/FASTA/human_T1.fa");
2158
2159 // 4. Set the output file: "out.fa".
2160 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Write Sequence"));
2161 GTMouseDriver::click();
2162 GTUtilsWorkflowDesigner::setParameter(os, "Output file", "out.fa", GTUtilsWorkflowDesigner::textValue);
2163
2164 // 5. Validate the workflow.
2165 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
2166 GTWidget::click(os, GTAction::button(os, "Validate workflow"));
2167
2168 // Expected: the workflow has the warning about FASTA format and annotations.
2169 CHECK_SET_ERR(GTUtilsWorkflowDesigner::checkErrorList(os, "") != 0, "There is no any messages in infoLog");
2170
2171 // 6. Run the workflow.
2172 GTWidget::click(os, GTAction::button(os, "Run workflow"));
2173
2174 // Expected: the button "Load schema" is shown.
2175 // expected button is in dashboard - it can't be checked for now
2176 }
2177
GUI_TEST_CLASS_DEFINITION(test_2373)2178 GUI_TEST_CLASS_DEFINITION(test_2373) {
2179 GTLogTracer logTracer;
2180
2181 // 1. Open "COI.aln"
2182 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW", "COI.aln");
2183 GTUtilsTaskTreeView::waitTaskFinished(os);
2184
2185 // 2. Move 'Mecopoda_elongata__Ishigaki__J' and 'Mecopoda_elongata__Sumatra_' to the end of name list
2186 GTUtilsMsaEditor::replaceSequence(os, "Mecopoda_elongata__Ishigaki__J", 17);
2187 GTUtilsMsaEditor::replaceSequence(os, "Mecopoda_elongata__Sumatra_", 17);
2188
2189 // 3. Press 'Switch on/off collapsing mode' tool button
2190 // Expected state: collapsing group, that contains two sequences, appeared
2191 GTUtilsMsaEditor::toggleCollapsingMode(os);
2192
2193 // 4. Mouse press on the group
2194 // Expected state: group selected
2195 GTUtilsMsaEditor::clickSequenceName(os, "Mecopoda_elongata__Ishigaki__J");
2196
2197 // 5. Mouse press under the group in the name list
2198 // Expected state: nothing happens
2199 GTMouseDriver::moveTo(GTUtilsMsaEditor::getSequenceNameRect(os, "Mecopoda_elongata__Ishigaki__J").center() + QPoint(0, 20));
2200 GTMouseDriver::click();
2201
2202 GTUtilsLog::check(os, logTracer);
2203 }
2204
GUI_TEST_CLASS_DEFINITION(test_2374)2205 GUI_TEST_CLASS_DEFINITION(test_2374) {
2206 // 1. Open WD
2207 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2208 // 2. Create scheme read alignment->write alignment
2209 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Alignment");
2210 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Alignment");
2211 GTUtilsWorkflowDesigner::connect(os, read, write);
2212 // 3. Set COI.aln as input, run scheme
2213 GTUtilsWorkflowDesigner::click(os, read);
2214 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/CLUSTALW/COI.aln");
2215 GTUtilsWorkflowDesigner::runWorkflow(os);
2216 GTUtilsTaskTreeView::waitTaskFinished(os);
2217 // Expected state: there is no "External Tools" page on the WD dashboards
2218 CHECK_SET_ERR(!GTUtilsDashboard::hasTab(os, GTUtilsDashboard::ExternalTools), "External tools tab exists, but is not expected!");
2219 }
2220
GUI_TEST_CLASS_DEFINITION(test_2375)2221 GUI_TEST_CLASS_DEFINITION(test_2375) {
2222 // 1. Open {_common_data/sam/broken_invalid_cigar.sam}
2223 // Expected state: import dialog appears.
2224
2225 // 2. Fill the import dialog with valid data. Begin the importing.
2226 // Expected state: importing fails, UGENE doesn't crash.
2227 QString destUrl = testDir + "_common_data/scenarios/sandbox/test_2375.ugenedb";
2228 GTLogTracer logtracer;
2229 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, destUrl));
2230 GTFileDialog::openFile(os, testDir + "_common_data/sam/", "broken_invalid_cigar.sam");
2231 GTUtilsTaskTreeView::waitTaskFinished(os);
2232
2233 TaskScheduler *scheduler = AppContext::getTaskScheduler();
2234 CHECK_SET_ERR(scheduler, "Task scheduler is NULL");
2235 while (!scheduler->getTopLevelTasks().isEmpty()) {
2236 GTGlobals::sleep();
2237 }
2238
2239 CHECK_SET_ERR(logtracer.hasErrors(), "Expected to have errors in the log, but no errors found");
2240 }
2241
GUI_TEST_CLASS_DEFINITION(test_2377)2242 GUI_TEST_CLASS_DEFINITION(test_2377) {
2243 GTLogTracer l;
2244 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2245
2246 const QString assemblyReaderName = "Read NGS Reads Assembly";
2247 const QString assemblyWriterName = "Write NGS Reads Assembly";
2248
2249 GTUtilsWorkflowDesigner::addAlgorithm(os, assemblyReaderName);
2250 GTUtilsWorkflowDesigner::addAlgorithm(os, assemblyWriterName);
2251
2252 WorkflowProcessItem *assemblyReader = GTUtilsWorkflowDesigner::getWorker(os,
2253 assemblyReaderName);
2254 WorkflowProcessItem *assemblyWriter = GTUtilsWorkflowDesigner::getWorker(os,
2255 assemblyWriterName);
2256
2257 GTUtilsWorkflowDesigner::connect(os, assemblyReader, assemblyWriter);
2258
2259 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, assemblyReaderName));
2260 GTMouseDriver::click();
2261 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/sam/broken_without_reads.sam");
2262
2263 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, assemblyWriterName));
2264 GTMouseDriver::click();
2265 GTUtilsWorkflowDesigner::setParameter(os, "Output file", "test", GTUtilsWorkflowDesigner::textValue);
2266
2267 GTWidget::click(os, GTAction::button(os, "Run workflow"));
2268
2269 CHECK_SET_ERR(l.hasErrors(), "Expected to have errors in the log, but no errors found");
2270 }
2271
GUI_TEST_CLASS_DEFINITION(test_2378)2272 GUI_TEST_CLASS_DEFINITION(test_2378) {
2273 GTLogTracer l;
2274 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, testDir + "_common_data/scenarios/sandbox/test_2378.ugenedb"));
2275 GTFileDialog::openFile(os, testDir + "_common_data/sam/", "scerevisiae.sam");
2276 GTUtilsTaskTreeView::waitTaskFinished(os);
2277 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
2278 }
2279
GUI_TEST_CLASS_DEFINITION(test_2378_1)2280 GUI_TEST_CLASS_DEFINITION(test_2378_1) {
2281 GTLogTracer l;
2282 // 1. Open WD
2283 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2284
2285 // 2. Create scheme: read assembly->write assembly
2286 // 3. set _common_data\sam\scerevisiae.sam as input file
2287 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read NGS Reads Assembly");
2288 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read NGS Reads Assembly"));
2289 GTMouseDriver::click();
2290 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/sam/scerevisiae.sam");
2291
2292 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write NGS Reads Assembly");
2293 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Write NGS Reads Assembly"));
2294 GTMouseDriver::click();
2295 QString path = QFileInfo(testDir + "_common_data/scenarios/sandbox/").absoluteFilePath();
2296 GTUtilsWorkflowDesigner::setParameter(os, "Output file", path + "/test_2378_1.bam", GTUtilsWorkflowDesigner::textValue);
2297
2298 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read NGS Reads Assembly"), GTUtilsWorkflowDesigner::getWorker(os, "Write NGS Reads Assembly"));
2299
2300 // 4. Run scheme
2301 GTWidget::click(os, GTAction::button(os, "Run workflow"));
2302 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
2303 }
2304
GUI_TEST_CLASS_DEFINITION(test_2379)2305 GUI_TEST_CLASS_DEFINITION(test_2379) {
2306 class CreateProjectFiller : public Filler {
2307 // It is a local support class, it is the same as SaveProjectAsDialogFiller,
2308 // but it clicks the final button with keyboard.
2309 // I know that it is bad practice to create so useless classes, but I don't need to extend the original class.
2310 // Do not move it to another place: if you need the same filler than extend the original class.
2311 public:
2312 CreateProjectFiller(HI::GUITestOpStatus &_os,
2313 const QString &_projectName,
2314 const QString &_projectFolder,
2315 const QString &_projectFile)
2316 : Filler(_os, "CreateNewProjectDialog"),
2317 projectName(_projectName),
2318 projectFolder(_projectFolder),
2319 projectFile(_projectFile) {
2320 }
2321
2322 virtual void run() {
2323 QWidget *dialog = GTWidget::getActiveModalWidget(os);
2324
2325 QLineEdit *projectNameEdit = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "projectNameEdit", dialog));
2326 GTLineEdit::setText(os, projectNameEdit, projectName);
2327
2328 QLineEdit *projectFileEdit = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "projectFilePathEdit", dialog));
2329 GTLineEdit::setText(os, projectFileEdit, projectFolder + "/" + projectFile);
2330
2331 #ifdef Q_OS_DARWIN
2332 GTWidget::click(os, GTWidget::findButtonByText(os, "Create", dialog));
2333 #else
2334 GTKeyboardDriver::keyClick(Qt::Key_Enter);
2335 #endif
2336 }
2337
2338 private:
2339 const QString projectName;
2340 const QString projectFolder;
2341 const QString projectFile;
2342 };
2343
2344 // 0. Create a project that will be "existing" in the second step
2345 const QString projectName = "test_2379";
2346 const QString projectFolder = testDir + "_common_data/scenarios/sandbox";
2347 const QString projectFile = "test_2379";
2348
2349 GTUtilsDialog::waitForDialog(os, new CreateProjectFiller(os, projectName, projectFolder, projectFile));
2350 GTMenu::clickMainMenuItem(os, QStringList() << "File"
2351 << "New project...");
2352 GTMenu::clickMainMenuItem(os, QStringList() << "File"
2353 << "Save all");
2354 GTMenu::clickMainMenuItem(os, QStringList() << "File"
2355 << "Close project");
2356
2357 // 1. Press "Create new project" button
2358 // 2. Specify the path to an existing project
2359 // 3. Press "Create" button by using keyboard
2360 // Expected state: only one dialog with warning message appeared
2361 GTUtilsDialog::waitForDialog(os, new CreateProjectFiller(os, projectName, projectFolder, projectFile));
2362 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Yes, "Project file already exists"));
2363
2364 GTMenu::clickMainMenuItem(os, QStringList() << "File"
2365 << "New project...");
2366 }
2367
GUI_TEST_CLASS_DEFINITION(test_2382)2368 GUI_TEST_CLASS_DEFINITION(test_2382) {
2369 // 1. Open "_common_data/ace/capres4.ace".
2370 // 2. "Import ACE file" dialog appeared. Press ok.
2371 // Expected state: export succeeded, assembly is displayed.
2372 GTLogTracer l;
2373
2374 QString sandboxDir = testDir + "_common_data/scenarios/sandbox/";
2375 QString assDocName = "test_2382.ugenedb";
2376 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, sandboxDir + assDocName));
2377 GTUtilsProject::openFile(os, testDir + "_common_data/ace/capres4.ace");
2378 GTUtilsTaskTreeView::waitTaskFinished(os);
2379
2380 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
2381
2382 GTUtilsProjectTreeView::findIndex(os, assDocName);
2383 }
2384
GUI_TEST_CLASS_DEFINITION(test_2382_1)2385 GUI_TEST_CLASS_DEFINITION(test_2382_1) {
2386 // 1. Open "_common_data/ace/test_new_.cap.ace".
2387 // 2. "Import ACE file" dialog appeared. Press ok.
2388 // Expected state: export succeeded, assembly is displayed.
2389 GTLogTracer l;
2390
2391 QString sandboxDir = testDir + "_common_data/scenarios/sandbox/";
2392 QString assDocName = "test_2382_1.ugenedb";
2393 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, sandboxDir + assDocName));
2394 GTUtilsProject::openFile(os, testDir + "_common_data/ace/test_new.cap.ace");
2395 GTUtilsTaskTreeView::waitTaskFinished(os);
2396
2397 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
2398
2399 GTUtilsProjectTreeView::findIndex(os, assDocName);
2400 }
2401
GUI_TEST_CLASS_DEFINITION(test_2387)2402 GUI_TEST_CLASS_DEFINITION(test_2387) {
2403 // 1) Click Open button in UGENE
2404 // 2) Select any two valid files, for example data/samples/Genbank/ PBR322.gb and sars.gb
2405 // 3) Click Open
2406 // Expected state: MultipleDocumentsReadingModeDialog appears
2407 // 4) Select merge option
2408 // 5) Replace one of the files with any binary file
2409 // 6) Click OK in MultipleDocumentsReadingModeDialog.
2410 // Expected state: UGENE not crashed
2411
2412 QString sandbox = testDir + "_common_data/scenarios/sandbox/";
2413
2414 GTFile::copy(os, dataDir + "samples/Genbank/PBR322.gb", sandbox + "PBR322.gb");
2415 GTFile::copy(os, dataDir + "samples/Genbank/sars.gb", sandbox + "sars.gb");
2416
2417 class SequenceReadingModeDialogUtils : public CustomScenario {
2418 public:
2419 // SequenceReadingModeDialogUtils(HI::GUITestOpStatus& _os) : GTSequenceReadingModeDialogUtils(_os){}
2420 virtual void run(HI::GUITestOpStatus &os) {
2421 GTSequenceReadingModeDialog::mode = GTSequenceReadingModeDialog::Merge;
2422 GTFile::copy(os, testDir + "_common_data/scenarios/_regression/2387/binary.dll", testDir + "_common_data/scenarios/sandbox/sars.gb");
2423 GTSequenceReadingModeDialogUtils(os).commonScenario();
2424 }
2425 };
2426
2427 // GTSequenceReadingModeDialogUtils "PBR322.gb" "sars.gb"
2428 GTUtilsDialog::waitForDialog(os, new GTSequenceReadingModeDialogUtils(os, new SequenceReadingModeDialogUtils()));
2429 GTFileDialog::openFileList(os, sandbox, QStringList() << "PBR322.gb"
2430 << "sars.gb");
2431 }
2432
GUI_TEST_CLASS_DEFINITION(test_2392)2433 GUI_TEST_CLASS_DEFINITION(test_2392) {
2434 // 1. Open file _common_data/genbank/multi.gb
2435 // Expected state: Open dialog "Sequence reading options"
2436 // 2. Select "Join sequences into alignment" option and press OK
2437 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Join));
2438 GTUtilsProject::openFile(os, testDir + "_common_data/genbank/multi.gb");
2439 GTUtilsTaskTreeView::waitTaskFinished(os);
2440
2441 // Expected state: Document opened in MSA view
2442 QStringList names = GTUtilsMSAEditorSequenceArea::getNameList(os);
2443 CHECK_SET_ERR(2 == names.size(), "Wrong sequence count");
2444 }
2445
GUI_TEST_CLASS_DEFINITION(test_2400)2446 GUI_TEST_CLASS_DEFINITION(test_2400) {
2447 // 1. Import samples/ACE/k26.ace to ugenedb (via open file)
2448 QString fileName = "2400.ugenedb";
2449 QString ugenedb = sandBoxDir + fileName;
2450 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, ugenedb));
2451 GTUtilsProject::openFile(os, testDir + "_common_data/ace/ace_test_1.ace");
2452 GTUtilsTaskTreeView::waitTaskFinished(os);
2453 // Expected state: assembly view for Contig_1 opened with refrence sequence added to it
2454 bool ref = GTUtilsAssemblyBrowser::hasReference(os, "1 [2400.ugenedb]");
2455 CHECK_SET_ERR(ref, "no reference")
2456 }
2457
GUI_TEST_CLASS_DEFINITION(test_2401)2458 GUI_TEST_CLASS_DEFINITION(test_2401) {
2459 // 1. Open the file "_common_data/ace/ace_test_1.ace".
2460 // 2. Set the ugenedb path for import: "_common_data/scenarios/sandbox/2401.ugenedb".
2461 // 3. Click OK
2462 QString sandbox = testDir + "_common_data/scenarios/sandbox/";
2463 QString fileName = "2401.ugenedb";
2464 QString ugenedb = sandbox + fileName;
2465 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, ugenedb));
2466 GTUtilsProject::openFile(os, testDir + "_common_data/ace/ace_test_1.ace");
2467 GTUtilsTaskTreeView::waitTaskFinished(os);
2468
2469 // Expected: the file is imported without errors, the assembly is opened.
2470 // 4. Close the project.
2471 GTUtilsDialog::waitForDialog(os, new SaveProjectDialogFiller(os, QDialogButtonBox::No));
2472 #ifdef Q_OS_DARWIN
2473 GTMenu::clickMainMenuItem(os, QStringList() << "File"
2474 << "Close project");
2475 #else
2476 GTKeyboardDriver::keyClick('q', Qt::ControlModifier);
2477 #endif
2478
2479 // 5. Open the file "_common_data/ace/ace_test_11_(error).ace".
2480 // 6. Set the same ugenedb path for import: "_common_data/scenarios/sandbox/2401.ugenedb".
2481 // 7. Click OK.
2482 // 8. Click Append.
2483 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, ugenedb));
2484 GTUtilsProject::openFile(os, testDir + "_common_data/ace/ace_test_11_(error).ace");
2485 GTUtilsTaskTreeView::waitTaskFinished(os);
2486
2487 // Expected: the file is not imported but "2401.ugenedb" still exists.
2488 QString s = GUrl(ugenedb).getURLString();
2489 CHECK_SET_ERR(QFile::exists(s), "ugenedb file does not exist");
2490
2491 // 9. Open the file "2401.ugenedb".
2492 GTFileDialog::openFile(os, sandbox, fileName);
2493 GTUtilsTaskTreeView::waitTaskFinished(os);
2494 // Expected: assembly is opened without errors.
2495 GTUtilsProjectTreeView::findIndex(os, fileName);
2496 }
2497
GUI_TEST_CLASS_DEFINITION(test_2402)2498 GUI_TEST_CLASS_DEFINITION(test_2402) {
2499 QDir outputDir(testDir + "_common_data/scenarios/sandbox");
2500 const QString outputFilePath = outputDir.absolutePath() + "/test_2402.gb";
2501
2502 // 1.Open Workflow Designer
2503 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2504
2505 // 2.Add 'Read Sequence' element
2506 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
2507 // 3. Add 'Assembly Sequences witn CAP3' element
2508 GTUtilsWorkflowDesigner::addAlgorithm(os, "Assembly Sequences with CAP3");
2509 WorkflowProcessItem *readWorker = GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence");
2510 WorkflowProcessItem *assemblyWorker = GTUtilsWorkflowDesigner::getWorker(os, "Assembly Sequences with CAP3");
2511 // 4. Connect elements
2512 GTUtilsWorkflowDesigner::connect(os, readWorker, assemblyWorker);
2513
2514 // Expected state: all slots are connected
2515 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
2516 GTMouseDriver::click();
2517 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Genbank/sars.gb");
2518 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Assembly Sequences with CAP3"));
2519 GTMouseDriver::click();
2520 GTUtilsWorkflowDesigner::setParameter(os, "Output file", outputFilePath, GTUtilsWorkflowDesigner::textValue);
2521
2522 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "Well done!"));
2523 GTWidget::click(os, GTAction::button(os, "Validate workflow"));
2524 }
2525
GUI_TEST_CLASS_DEFINITION(test_2403)2526 GUI_TEST_CLASS_DEFINITION(test_2403) {
2527 // 1. Open "human_T1.fa".
2528 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
2529 GTUtilsTaskTreeView::waitTaskFinished(os);
2530
2531 // 2. Resize the main UGENE window that not all buttons will be visible on the sequence toolbar.
2532 QMainWindow *mw = AppContext::getMainWindow()->getQMainWindow();
2533 GTWidget::showNormal(os, mw);
2534 GTWidget::resizeWidget(os, mw, QSize(300, mw->size().height()));
2535
2536 // 3. Click on the "Show full toolbar" button.
2537 QWidget *toolbarWidget = GTWidget::findWidget(os, "mwtoolbar_activemdi");
2538 CHECK_SET_ERR(nullptr != toolbarWidget, "Toolbar is not present");
2539 QWidget *expandWidget = GTWidget::findWidget(os, "qt_toolbar_ext_button", toolbarWidget);
2540 CHECK_SET_ERR(nullptr != expandWidget, "\"Show full toolbar\" button is not present");
2541
2542 GTWidget::click(os, expandWidget);
2543
2544 // Expected: all toolbar actions appears.
2545 QWidget *toggleWidget = GTWidget::findWidget(os, "toggleViewButton", toolbarWidget);
2546 CHECK_SET_ERR(nullptr != toggleWidget, "\"Toggle view\" button is not present");
2547
2548 GTWidget::click(os, expandWidget);
2549 }
2550
GUI_TEST_CLASS_DEFINITION(test_2404)2551 GUI_TEST_CLASS_DEFINITION(test_2404) {
2552 /* 1. Open human_T1.fa
2553 2. Open Search in sequence OP tab
2554 3. Input "AAAAA" pattern to the Search for: field
2555 4. Expand all available parameters
2556 Expected: scrollbar appears
2557 Current: layout breaks
2558 */
2559 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
2560 GTUtilsTaskTreeView::waitTaskFinished(os);
2561 GTUtilsOptionsPanel::runFindPatternWithHotKey("AAAAA", os);
2562 GTWidget::click(os, GTWidget::findWidget(os, "ArrowHeader_Search algorithm"));
2563 GTWidget::click(os, GTWidget::findWidget(os, "ArrowHeader_Search in"));
2564 GTWidget::click(os, GTWidget::findWidget(os, "ArrowHeader_Other settings"));
2565 GTWidget::click(os, GTWidget::findWidget(os, "ArrowHeader_Save annotation(s) to"));
2566 GTWidget::click(os, GTWidget::findWidget(os, "ArrowHeader_Annotation parameters"));
2567 QScrollArea *sa = qobject_cast<QScrollArea *>(GTWidget::findWidget(os, "OP_SCROLL_AREA"));
2568 QScrollBar *scroll = sa->verticalScrollBar();
2569 CHECK_SET_ERR(scroll != nullptr, "Scroll bar is NULL");
2570 CHECK_SET_ERR(scroll->isVisible(), "Scroll bar is invisible!");
2571 }
2572
GUI_TEST_CLASS_DEFINITION(test_2406)2573 GUI_TEST_CLASS_DEFINITION(test_2406) {
2574 // 1. Create the {Read Sequence -> Write Sequence} workflow.
2575 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2576
2577 const QString sequenceReaderName = "Read Sequence";
2578 const QString sequenceWriterName = "Write Sequence";
2579
2580 GTUtilsWorkflowDesigner::addAlgorithm(os, sequenceReaderName, true);
2581 GTUtilsWorkflowDesigner::addAlgorithm(os, sequenceWriterName, true);
2582
2583 WorkflowProcessItem *sequenceReader = GTUtilsWorkflowDesigner::getWorker(os, sequenceReaderName);
2584 WorkflowProcessItem *sequenceWriter = GTUtilsWorkflowDesigner::getWorker(os, sequenceWriterName);
2585
2586 CHECK_SET_ERR(nullptr != sequenceReader, "Sequence reader element is NULL");
2587 CHECK_SET_ERR(nullptr != sequenceWriter, "Sequence writer element is NULL");
2588
2589 GTUtilsWorkflowDesigner::connect(os, sequenceReader, sequenceWriter);
2590
2591 // 2. Click on the output file field and input "TEST" file name and press Enter.
2592 // Expected: TEST file name appears in the output file name field
2593 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, sequenceWriterName));
2594 GTMouseDriver::click();
2595 GTUtilsWorkflowDesigner::setParameter(os, "Output file", "TEST", GTUtilsWorkflowDesigner::textValue);
2596 GTKeyboardDriver::keyClick(Qt::Key_Enter);
2597 GTKeyboardDriver::keyClick(Qt::Key_Enter);
2598
2599 const QString expectedPreValue = "TEST";
2600 const QString resultPreValue = GTUtilsWorkflowDesigner::getParameter(os, "Output file", true);
2601 CHECK_SET_ERR(expectedPreValue == resultPreValue,
2602 QString("Unexpected value: expected '%1' get '%2'").arg(expectedPreValue).arg(resultPreValue));
2603
2604 // 3. Change the file format to the genbank
2605 // Expected: TEST.gb file name appears in the output file name field
2606 GTUtilsWorkflowDesigner::setParameter(os, "Document format", "GenBank", GTUtilsWorkflowDesigner::comboValue);
2607
2608 const QString expectedPostValue = "TEST.gb";
2609 const QString resultPostValue = GTUtilsWorkflowDesigner::getParameter(os, "Output file", true);
2610 CHECK_SET_ERR(expectedPostValue == resultPostValue,
2611 QString("Unexpected value: expected '%1' get '%2'").arg(expectedPostValue).arg(resultPostValue));
2612 }
2613
GUI_TEST_CLASS_DEFINITION(test_2407)2614 GUI_TEST_CLASS_DEFINITION(test_2407) {
2615 GTLogTracer l;
2616 GTFileDialog::openFile(os, testDir + "_common_data/clustal/", "10000_sequences.aln");
2617 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
2618 GTUtilsTaskTreeView::waitTaskFinished(os);
2619
2620 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "10000_sequences.aln"));
2621
2622 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Yes));
2623 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ACTION_PROJECT__UNLOAD_SELECTED));
2624 GTMouseDriver::click(Qt::RightButton);
2625 GTUtilsTaskTreeView::waitTaskFinished(os);
2626 GTUtilsDialog::waitAllFinished(os);
2627
2628 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "10000_sequences.aln"));
2629 GTMouseDriver::doubleClick();
2630 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
2631 GTUtilsTaskTreeView::waitTaskFinished(os);
2632
2633 GTKeyboardDriver::keyClick(Qt::Key_Delete);
2634
2635 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
2636 }
2637
GUI_TEST_CLASS_DEFINITION(test_2410)2638 GUI_TEST_CLASS_DEFINITION(test_2410) {
2639 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
2640 GTUtilsTaskTreeView::waitTaskFinished(os);
2641
2642 GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os, 166740, 166755));
2643
2644 QWidget *sequenceWidget = GTWidget::findWidget(os, "ADV_single_sequence_widget_0");
2645 CHECK_SET_ERR(nullptr != sequenceWidget, "sequenceWidget is not present");
2646
2647 GTWidget::click(os, sequenceWidget);
2648 GTKeyboardUtils::selectAll();
2649
2650 QWidget *graphAction = GTWidget::findWidget(os, "GraphMenuAction", sequenceWidget, false);
2651 Runnable *chooser = new PopupChooser(os, QStringList() << "GC Content (%)");
2652 GTUtilsDialog::waitForDialog(os, chooser);
2653
2654 GTWidget::click(os, graphAction);
2655 GTUtilsTaskTreeView::waitTaskFinished(os);
2656
2657 GTWidget::click(os, GTAction::button(os, "action_zoom_in_human_T1 (UCSC April 2002 chr7:115977709-117855134)"));
2658
2659 QWidget *renderArea = GTWidget::findWidget(os, "GSequenceGraphViewRenderArea", sequenceWidget);
2660 const QPoint mouseInitialPos(4 * renderArea->width() / 7, renderArea->height() / 2);
2661 GTWidget::click(os, renderArea, Qt::LeftButton, mouseInitialPos);
2662
2663 const QPoint mouseInitialAbsPos = GTMouseDriver::getMousePosition();
2664 const int rightMouseLimit = mouseInitialAbsPos.x() * 1.3;
2665
2666 for (int x = mouseInitialAbsPos.x(); x < rightMouseLimit; x += 5) {
2667 const QPoint currentPos(x, mouseInitialAbsPos.y());
2668 GTMouseDriver::moveTo(currentPos);
2669 }
2670 }
2671
GUI_TEST_CLASS_DEFINITION(test_2415)2672 GUI_TEST_CLASS_DEFINITION(test_2415) {
2673 // 1. Open "samples/FASTA/human_T1.fa".
2674 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
2675 GTUtilsTaskTreeView::waitTaskFinished(os);
2676
2677 // 2. Right click on the object sequence name in the project view.
2678 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "human_T1 (UCSC April 2002 chr7:115977709-117855134)"));
2679
2680 // 3. Click the menu {Edit -> Rename}.
2681 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Rename"));
2682 GTMouseDriver::click(Qt::RightButton);
2683
2684 // 4. Enter the new name: "name".
2685 GTKeyboardDriver::keySequence("name");
2686
2687 // 5. Press Enter.
2688 GTKeyboardDriver::keyClick(Qt::Key_Enter);
2689
2690 // Expected state: the sequence is renamed.
2691 GTUtilsProjectTreeView::findIndex(os, "name");
2692 }
2693
GUI_TEST_CLASS_DEFINITION(test_2424)2694 GUI_TEST_CLASS_DEFINITION(test_2424) {
2695 // 1. Open WD. Add Read Sequence, Write sequence and Filter quality (custm element with script section) workers. Make sure Fitler Quality worker's script text is empty.
2696 QString workflowOutputDirPath(testDir + "_common_data/scenarios/sandbox");
2697 QDir workflowOutputDir(workflowOutputDirPath);
2698 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2699
2700 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
2701 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Sequence", true);
2702 GTUtilsWorkflowDesigner::addAlgorithm(os, "Quality Filter Example");
2703
2704 WorkflowProcessItem *seqReader = GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence");
2705 WorkflowProcessItem *seqWriter = GTUtilsWorkflowDesigner::getWorker(os, "Write Sequence");
2706 WorkflowProcessItem *qualFilter = GTUtilsWorkflowDesigner::getWorker(os, "Quality Filter Example");
2707
2708 GTUtilsWorkflowDesigner::connect(os, seqReader, qualFilter);
2709 GTUtilsWorkflowDesigner::connect(os, qualFilter, seqWriter);
2710 // 2. Connect workers into schema, set input data and output data (for example eas.fastq from samples)
2711 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
2712 GTMouseDriver::click();
2713 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/FASTA/human_T1.fa");
2714
2715 const QString outputFilePath = workflowOutputDir.absolutePath() + "/test.gb";
2716
2717 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Write Sequence"));
2718 GTMouseDriver::click();
2719 GTUtilsWorkflowDesigner::setParameter(os, "Output file", outputFilePath, GTUtilsWorkflowDesigner::textValue);
2720 // 3. Launch the schema.
2721 // Expected state: schema didnt start, error "Quality filter example"
2722 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
2723 GTWidget::click(os, GTAction::button(os, "Run workflow"));
2724 GTUtilsWorkflowDesigner::checkErrorList(os, "Quality Filter Example: Empty script text");
2725 }
2726
GUI_TEST_CLASS_DEFINITION(test_2430)2727 GUI_TEST_CLASS_DEFINITION(test_2430) {
2728 // 1. Check the debug mode checkbox in the applications settings
2729 // 2. Add an element to the scene
2730 // 3. Open breakpoints manager
2731 // 4. Try to add the breakpoint to the element by shortcut (Ctrl+B)
2732 // Current: nothing happens
2733 // Expected: the breakpoint appears
2734
2735 GTUtilsWorkflowDesigner::toggleDebugMode(os);
2736 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2737 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
2738 GTUtilsWorkflowDesigner::toggleBreakpointManager(os);
2739
2740 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
2741 GTMouseDriver::click();
2742 GTKeyboardDriver::keyClick('b', Qt::ControlModifier);
2743
2744 QStringList breakpoints = GTUtilsWorkflowDesigner::getBreakpointList(os);
2745 CHECK_SET_ERR(breakpoints.size() == 1, "Wrong amount of breakpoints!");
2746 }
2747
GUI_TEST_CLASS_DEFINITION(test_2431)2748 GUI_TEST_CLASS_DEFINITION(test_2431) {
2749 // 1. Check the debug mode checkbox in the applications settings
2750 // 2. Add an element to the scene
2751 // 3. Try to delete the element by delete button
2752 // Current: nothing happens
2753 // Expected: the element will be deleted
2754
2755 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2756 GTUtilsWorkflowDesigner::toggleDebugMode(os);
2757
2758 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
2759 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
2760 GTKeyboardDriver::keyClick(Qt::Key_Delete);
2761 WorkflowProcessItem *readSeq = GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence", GTGlobals::FindOptions(false));
2762 CHECK_SET_ERR(readSeq == nullptr, "Item didn't deleted");
2763 }
2764
GUI_TEST_CLASS_DEFINITION(test_2432)2765 GUI_TEST_CLASS_DEFINITION(test_2432) {
2766 // 1. Check the debug mode checkbox in the applications settings
2767 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2768 GTUtilsWorkflowDesigner::toggleDebugMode(os);
2769 GTUtilsWorkflowDesigner::toggleBreakpointManager(os);
2770
2771 // 2. Add an element to the scene
2772 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read File URL(s)");
2773
2774 // 3. Add the breakpoint to the element
2775 GTUtilsWorkflowDesigner::setBreakpoint(os, "Read File URL(s)");
2776
2777 // 4. Delete the element
2778 // Expected: there are no breakpoints in the breakpoints manager
2779 GTUtilsWorkflowDesigner::removeItem(os, "Read File URL(s)");
2780 const QStringList breakpoints = GTUtilsWorkflowDesigner::getBreakpointList(os);
2781 CHECK_SET_ERR(breakpoints.isEmpty(), "There are breakpoints in the workflow");
2782 }
2783
GUI_TEST_CLASS_DEFINITION(test_2449)2784 GUI_TEST_CLASS_DEFINITION(test_2449) {
2785 // 1. Open "COI.aln".
2786 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
2787 GTUtilsTaskTreeView::waitTaskFinished(os);
2788
2789 // 2. Create a phylogenetic tree for the alignment.
2790 GTUtilsDialog::waitForDialog(os, new BuildTreeDialogFiller(os, sandBoxDir + "test_2449.nwk", 0, 0, true));
2791 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
2792 << "Tree"
2793 << "Build Tree");
2794 GTUtilsTaskTreeView::waitTaskFinished(os);
2795
2796 // 3. Open tree options panel widget (it can be opened automatically after tree building).
2797 // 4. Open font settings on the OP widget.
2798 GTWidget::click(os, GTWidget::findWidget(os, "lblFontSettings"));
2799
2800 // There is a font size spinbox. You can set zero value to it: in this case font has its standard size (on mac), but this value is incorrect.
2801 QSpinBox *sizeSpinBox = qobject_cast<QSpinBox *>(GTWidget::findWidget(os, "fontSizeSpinBox"));
2802 CHECK_SET_ERR(nullptr != sizeSpinBox, "Size spin box not found");
2803
2804 GTWidget::setFocus(os, sizeSpinBox);
2805 int prev = 0;
2806 while (0 < sizeSpinBox->value()) {
2807 prev = sizeSpinBox->value();
2808 GTKeyboardDriver::keyClick(Qt::Key_Down);
2809 if (prev <= sizeSpinBox->value()) {
2810 break;
2811 }
2812 }
2813
2814 CHECK_SET_ERR(0 < sizeSpinBox->value(), "Invalid size spin box bound");
2815 }
2816
GUI_TEST_CLASS_DEFINITION(test_2451)2817 GUI_TEST_CLASS_DEFINITION(test_2451) {
2818 // 1. Open Workflow designer
2819 GTLogTracer l;
2820 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2821 // 2. Open sample {Alignment->Align sequences with MUSCLE}
2822 GTUtilsWorkflowDesigner::addSample(os, "Align sequences with MUSCLE");
2823 // Expected state: There is "Show wizard" tool button
2824
2825 // 3. Press "Show wizard" button
2826
2827 class customWizard : public CustomScenario {
2828 public:
2829 void run(HI::GUITestOpStatus &os) {
2830 // 4. Select input MSA "samples\CLUSTALW\COI.aln"
2831 GTUtilsWizard::setInputFiles(os, QList<QStringList>() << (QStringList() << dataDir + "samples/CLUSTALW/COI.aln"));
2832 // 5. Press "Next" button
2833 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
2834 // 6. Press "Run" button
2835 GTUtilsWizard::clickButton(os, GTUtilsWizard::Run);
2836 }
2837 };
2838
2839 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Align Sequences with MUSCLE Wizard", new customWizard()));
2840 GTWidget::click(os, GTAction::button(os, "Show wizard"));
2841 // Expected state: Align sequences with MUSCLE Wizard appeared
2842
2843 // Expected state: Scheme successfully performed
2844 GTUtilsTaskTreeView::waitTaskFinished(os);
2845 GTUtilsLog::check(os, l);
2846 }
2847
GUI_TEST_CLASS_DEFINITION(test_2459)2848 GUI_TEST_CLASS_DEFINITION(test_2459) {
2849 // 1. Open "COI.aln".
2850 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW", "COI.aln");
2851 GTUtilsTaskTreeView::waitTaskFinished(os);
2852
2853 // 2. Set any reference sequence.
2854 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Set this sequence as reference"));
2855 GTWidget::click(os, GTUtilsMSAEditorSequenceArea::getSequenceArea(os), Qt::RightButton, QPoint(10, 10));
2856
2857 // 3. Open context menu, open the "Highlighting" submenu, set the "Agreements" type.
2858 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Appearance"
2859 << "Highlighting"
2860 << "Agreements"));
2861 GTWidget::click(os, GTUtilsMSAEditorSequenceArea::getSequenceArea(os), Qt::RightButton);
2862
2863 // 4. Open context menu again, open the "Export" submenu, choose the "Export highlighted" menu item.
2864 // Expected state: the "Export highlighted to file" dialog appears.
2865
2866 // 5. Set any valid filename, other settings should be default. Click "Export".
2867 // Expected state: exporting successfully completes, UGENE doesn't crash.
2868 // Current state: UGENE crashes.
2869 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Export"
2870 << "Export highlighted"));
2871 GTUtilsDialog::waitForDialog(os, new ExportHighlightedDialogFiller(os, sandBoxDir + "test_2459.txt"));
2872 GTWidget::click(os, GTUtilsMSAEditorSequenceArea::getSequenceArea(os), Qt::RightButton);
2873 }
2874
GUI_TEST_CLASS_DEFINITION(test_2460)2875 GUI_TEST_CLASS_DEFINITION(test_2460) {
2876 // 1. Open "COI.aln".
2877
2878 GTLogTracer l;
2879 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/COI.aln");
2880 GTUtilsTaskTreeView::waitTaskFinished(os);
2881
2882 // 2. Remove all sequences except the first one.
2883 QStringList list = GTUtilsMSAEditorSequenceArea::getNameList(os);
2884 GTUtilsMsaEditor::removeRows(os, 1, list.size() - 1);
2885
2886 // 3. Align the result one-line-msa by kalign with default values.
2887 GTUtilsDialog::waitForDialog(os, new KalignDialogFiller(os));
2888 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "align_with_kalign"));
2889 GTMouseDriver::click(Qt::RightButton);
2890
2891 GTUtilsTaskTreeView::waitTaskFinished(os);
2892
2893 // Expected state: Kalign task finishes with error. Redo button is disabled.
2894 CHECK_SET_ERR(l.hasErrors(), "Expected to have errors in the log, but no errors found");
2895
2896 QAbstractButton *redo = GTAction::button(os, "msa_action_redo");
2897 CHECK_SET_ERR(nullptr != redo, "There is no REDO button");
2898 CHECK_SET_ERR(redo->isEnabled() == false, "REDO button is enabled");
2899 }
2900
GUI_TEST_CLASS_DEFINITION(test_2470)2901 GUI_TEST_CLASS_DEFINITION(test_2470) {
2902 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/2470", "blast_result.gb");
2903 GTUtilsTaskTreeView::waitTaskFinished(os);
2904 QList<QTreeWidgetItem *> blastResultItems = GTUtilsAnnotationsTreeView::findItems(os, "blast result");
2905 GTUtilsAnnotationsTreeView::selectItems(os, blastResultItems);
2906
2907 class OkClicker : public Filler {
2908 public:
2909 OkClicker(HI::GUITestOpStatus &_os, const QString &dbPath, const QString &outputPath)
2910 : Filler(_os, "BlastDBCmdDialog"), dbPath(dbPath), outputPath(outputPath) {
2911 }
2912 virtual void run() {
2913 QWidget *w = QApplication::activeWindow();
2914 CHECK(nullptr != w, );
2915
2916 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, dbPath));
2917 GTWidget::click(os, GTWidget::findWidget(os, "selectDatabasePushButton", w));
2918 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, outputPath, GTGlobals::UseMouse, GTFileDialogUtils::Save));
2919 GTWidget::click(os, GTWidget::findWidget(os, "browseOutputButton", w));
2920
2921 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
2922 CHECK(nullptr != buttonBox, );
2923 QPushButton *button = buttonBox->button(QDialogButtonBox::Ok);
2924 CHECK(nullptr != button, );
2925 GTWidget::click(os, button);
2926 };
2927
2928 private:
2929 const QString dbPath;
2930 const QString outputPath;
2931 };
2932
2933 GTUtilsDialog::waitForDialog(os, new OkClicker(os, testDir + "_common_data/scenarios/_regression/2470/nice_base.nhr", testDir + "_common_data/scenarios/sandbox/2470_fetched.fa"));
2934 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "fetchMenu"
2935 << "fetchSequenceById"));
2936 GTMouseDriver::click(Qt::RightButton);
2937 GTUtilsTaskTreeView::waitTaskFinished(os);
2938
2939 GTUtilsProjectTreeView::getItemCenter(os, "Conocephalus_sp.");
2940 GTUtilsProjectTreeView::getItemCenter(os, "Montana_montana");
2941 GTUtilsProjectTreeView::getItemCenter(os, "Gampsocleis_sedakovii_EF540828");
2942 }
2943
GUI_TEST_CLASS_DEFINITION(test_2470_1)2944 GUI_TEST_CLASS_DEFINITION(test_2470_1) {
2945 GTUtilsExternalTools::removeTool(os, "BlastAll");
2946 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/2470", "blast_result.gb");
2947 GTUtilsTaskTreeView::waitTaskFinished(os);
2948 QList<QTreeWidgetItem *> blastResultItems = GTUtilsAnnotationsTreeView::findItems(os, "blast result");
2949 GTUtilsAnnotationsTreeView::selectItems(os, blastResultItems);
2950
2951 class OkClicker : public Filler {
2952 public:
2953 OkClicker(HI::GUITestOpStatus &_os, const QString &dbPath, const QString &outputPath)
2954 : Filler(_os, "BlastDBCmdDialog"), dbPath(dbPath), outputPath(outputPath) {};
2955 virtual void run() {
2956 QWidget *w = QApplication::activeWindow();
2957 CHECK(nullptr != w, );
2958
2959 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, dbPath));
2960 GTWidget::click(os, GTWidget::findWidget(os, "selectDatabasePushButton", w));
2961 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, outputPath, GTGlobals::UseMouse, GTFileDialogUtils::Save));
2962 GTWidget::click(os, GTWidget::findWidget(os, "browseOutputButton", w));
2963
2964 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
2965 CHECK(nullptr != buttonBox, );
2966 QPushButton *button = buttonBox->button(QDialogButtonBox::Ok);
2967 CHECK(nullptr != button, );
2968 GTWidget::click(os, button);
2969 };
2970
2971 private:
2972 const QString dbPath;
2973 const QString outputPath;
2974 };
2975
2976 GTUtilsDialog::waitForDialog(os, new OkClicker(os, testDir + "_common_data/scenarios/_regression/2470/nice_base.nhr", testDir + "_common_data/scenarios/sandbox/2470_1_fetched.fa"));
2977 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "fetchMenu"
2978 << "fetchSequenceById"));
2979 GTMouseDriver::click(Qt::RightButton);
2980 GTUtilsTaskTreeView::waitTaskFinished(os);
2981
2982 GTUtilsProjectTreeView::getItemCenter(os, "Conocephalus_sp.");
2983 GTUtilsProjectTreeView::getItemCenter(os, "Montana_montana");
2984 GTUtilsProjectTreeView::getItemCenter(os, "Gampsocleis_sedakovii_EF540828");
2985 }
2986
GUI_TEST_CLASS_DEFINITION(test_2475)2987 GUI_TEST_CLASS_DEFINITION(test_2475) {
2988 // 1. Open WD.
2989 // 2. Open Single-sample (NGS samples).
2990 // 3. Set proper input data.
2991 // 4. Validate scheme.
2992 // Expected state: validation passed.
2993
2994 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2995
2996 GTUtilsDialog::waitForDialog(os, new DefaultWizardFiller(os, "Tuxedo Wizard"));
2997 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Tuxedo Workflow", QStringList() << "Single-sample"
2998 << "Single-end"));
2999 GTUtilsWorkflowDesigner::addSample(os, "RNA-seq analysis with Tuxedo tools");
3000
3001 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read RNA-seq Short Reads"));
3002 GTMouseDriver::click();
3003 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/bowtie2/reads_1.fq");
3004 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/bowtie2/reads_2.fq");
3005
3006 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Find Splice Junctions with TopHat"));
3007 GTMouseDriver::click();
3008 GTUtilsWorkflowDesigner::setParameter(os, "Bowtie index folder", testDir + "_common_data/bowtie2/index", GTUtilsWorkflowDesigner::textValue);
3009 GTUtilsWorkflowDesigner::setParameter(os, "Bowtie index basename", "human_T1_cutted", GTUtilsWorkflowDesigner::textValue);
3010
3011 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
3012 GTWidget::click(os, GTAction::button(os, "Validate workflow"));
3013 }
3014
GUI_TEST_CLASS_DEFINITION(test_2482)3015 GUI_TEST_CLASS_DEFINITION(test_2482) {
3016 // 1. Open "COI.nwk".
3017 GTFileDialog::openFile(os, dataDir + "samples/Newick/", "COI.nwk");
3018 GTUtilsTaskTreeView::waitTaskFinished(os);
3019
3020 // 2. Change the tree layout to unrooted.
3021 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Unrooted"));
3022 GTWidget::click(os, GTWidget::findWidget(os, "Layout"));
3023
3024 // 3. Select any node in the tree that is not a leaf.
3025 QList<GraphicsButtonItem *> items = GTUtilsPhyTree::getNodes(os);
3026 CHECK_SET_ERR(items.size() >= 4, "Incorrect tree size");
3027
3028 QPoint nodeCoords = GTUtilsPhyTree::getGlobalCenterCoord(os, items.at(3));
3029 GTMouseDriver::moveTo(nodeCoords);
3030
3031 GTMouseDriver::click();
3032
3033 // 4. Call context menu on the Tree Viewer.
3034 // Expected state: menu items "Swap Sublings" and "Reroot tree" are disabled.
3035 GTUtilsDialog::waitForDialog(os, new PopupCheckerByText(os, QStringList() << "Reroot tree", PopupChecker::IsDisabled));
3036 GTMouseDriver::click(Qt::RightButton);
3037
3038 GTUtilsDialog::waitForDialog(os, new PopupCheckerByText(os, QStringList() << "Swap Siblings", PopupChecker::IsDisabled));
3039 GTMouseDriver::click(Qt::RightButton);
3040 }
3041
GUI_TEST_CLASS_DEFINITION(test_2487)3042 GUI_TEST_CLASS_DEFINITION(test_2487) {
3043 // 1. Open "COI.nwk".
3044 // 2. Select root-node.
3045 // 3. Call context menu.
3046 // 'Reroot tree' and 'Collapse ' options must be disabled
3047
3048 GTFileDialog::openFile(os, dataDir + "samples/Newick/", "COI.nwk");
3049 GTUtilsTaskTreeView::waitTaskFinished(os);
3050
3051 QList<GraphicsButtonItem *> items = GTUtilsPhyTree::getNodes(os);
3052 CHECK_SET_ERR(items.size() != 0, "Tree is empty");
3053
3054 QPoint rootCoords = GTUtilsPhyTree::getGlobalCenterCoord(os, items.first());
3055 GTMouseDriver::moveTo(rootCoords);
3056 GTMouseDriver::click();
3057
3058 GTUtilsDialog::waitForDialog(os, new PopupCheckerByText(os, QStringList() << "Reroot tree", PopupChecker::IsDisabled));
3059 GTMouseDriver::click(Qt::RightButton);
3060
3061 GTUtilsDialog::waitForDialog(os, new PopupCheckerByText(os, QStringList() << "Collapse", PopupChecker::IsDisabled));
3062 GTMouseDriver::click(Qt::RightButton);
3063 }
3064
GUI_TEST_CLASS_DEFINITION(test_2496)3065 GUI_TEST_CLASS_DEFINITION(test_2496) {
3066 // 1. Open file testDir/_common_data/scenarios/assembly/example-alignment.bam
3067 // Expected state: import bam dialog appeared
3068
3069 GTUtilsDialog::waitForDialog(os,
3070 new ImportBAMFileFiller(os, testDir + "_common_data/scenarios/sandbox/example-alignment.bam.ugenedb"));
3071 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/assembly/", "example-alignment.bam");
3072 GTUtilsTaskTreeView::waitTaskFinished(os);
3073 }
3074
GUI_TEST_CLASS_DEFINITION(test_2498)3075 GUI_TEST_CLASS_DEFINITION(test_2498) {
3076 // 1. Open the /test/_common_data/fasta/empty.fa empty msa file.
3077 // 2. Open context menu on the sequence area. Go to the {Export -> amino translation}
3078 //
3079 GTFileDialog::openFile(os, testDir + "_common_data/fasta/", "empty.fa");
3080 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
3081 GTUtils::checkExportServiceIsEnabled(os);
3082
3083 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(0, 0));
3084
3085 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << MSAE_MENU_EXPORT << "amino_translation_of_alignment_rows", PopupChecker::IsDisabled, GTGlobals::UseMouse));
3086 GTMouseDriver::click(Qt::RightButton);
3087
3088 // TODO: Expected state: this menu item is disabled for the empty msa.
3089 }
3090
GUI_TEST_CLASS_DEFINITION(test_2506)3091 GUI_TEST_CLASS_DEFINITION(test_2506) {
3092 // 1. Open file _common_data/vcf_consensus/vcf_cons_out_damaged_1.vcf
3093 // Expected state: error message appears.
3094 GTLogTracer l;
3095
3096 GTFileDialog::openFile(os, testDir + "_common_data/vcf_consensus/", "vcf_cons_out_damaged_1.vcf");
3097 GTUtilsTaskTreeView::waitTaskFinished(os);
3098
3099 CHECK_SET_ERR(l.hasErrors(), "Expected to have errors in the log, but no errors found");
3100 }
3101
GUI_TEST_CLASS_DEFINITION(test_2506_1)3102 GUI_TEST_CLASS_DEFINITION(test_2506_1) {
3103 // 1. Open file _common_data/vcf_consensus/vcf_cons_out_damaged_2.vcf
3104 // Expected state: error message appears.
3105 GTLogTracer l;
3106
3107 GTFileDialog::openFile(os, testDir + "_common_data/vcf_consensus/", "vcf_cons_out_damaged_2.vcf");
3108 GTUtilsTaskTreeView::waitTaskFinished(os);
3109
3110 CHECK_SET_ERR(l.hasErrors(), "Expected to have errors in the log, but no errors found");
3111 }
3112
GUI_TEST_CLASS_DEFINITION(test_2513)3113 GUI_TEST_CLASS_DEFINITION(test_2513) {
3114 // Open COI.nwk.
3115 GTFileDialog::openFile(os, dataDir + "/samples/Newick/", "COI.nwk");
3116 GTUtilsTaskTreeView::waitTaskFinished(os);
3117
3118 // Switch to the circular layout on the tree view.
3119 GTWidget::click(os, GTWidget::findWidget(os, "OP_TREES_WIDGET"));
3120 QComboBox *layoutCombo = GTWidget::findExactWidget<QComboBox *>(os, "layoutCombo");
3121 GTComboBox::selectItemByText(os, layoutCombo, "Circular");
3122 GTUtilsTaskTreeView::waitTaskFinished(os);
3123
3124 // Select the last node, then call a context menu for it. It contains two menu items: "swap siblings" and "reroot".
3125 // The first one should be always disabled (for the tree leafs), the second one should be always enabled.
3126 QList<GraphicsButtonItem *> nodes = GTUtilsPhyTree::getNodes(os);
3127 CHECK_SET_ERR(!nodes.isEmpty(), "Nodes list is empty");
3128
3129 GTUtilsPhyTree::clickNode(os, nodes[25]);
3130 CHECK_SET_ERR(!GTUtilsPhyTree::getSelectedNodes(os).isEmpty(), "A clicked node wasn't selected");
3131 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << "Swap Siblings", PopupChecker::IsDisabled));
3132 GTMouseDriver::click(Qt::RightButton);
3133 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << "Reroot tree", PopupChecker::IsEnabled));
3134 GTMouseDriver::click(Qt::RightButton);
3135
3136 GTUtilsPhyTree::clickNode(os, nodes[22]);
3137 CHECK_SET_ERR(!GTUtilsPhyTree::getSelectedNodes(os).isEmpty(), "A clicked node wasn't selected");
3138 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << "Swap Siblings", PopupChecker::IsEnabled));
3139 GTMouseDriver::click(Qt::RightButton);
3140 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << "Reroot tree", PopupChecker::IsEnabled));
3141 GTMouseDriver::click(Qt::RightButton);
3142 }
3143
GUI_TEST_CLASS_DEFINITION(test_2519)3144 GUI_TEST_CLASS_DEFINITION(test_2519) {
3145 // 1. Open {data/samples/FASTA/human_T1.fa}.
3146 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3147 GTUtilsTaskTreeView::waitTaskFinished(os);
3148
3149 // 2. Go to position 20000.
3150 GTUtilsDialog::waitForDialog(os, new GoToDialogFiller(os, 20000));
3151 GTKeyboardDriver::keyClick('g', Qt::ControlModifier);
3152
3153 // 3. Call context menu, select menu item {Edit sequence -> Remove subsequence...}.
3154 // Expected state: a "Remove subsequence" dialog appears.
3155 // 4. Set the region (1..190950), other settings should be default, click the "Remove" button.
3156 // Expected state: UGENE doesn't crash.
3157 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_EDIT << ACTION_EDIT_REMOVE_SUBSEQUENCE));
3158 GTUtilsDialog::waitForDialog(os, new RemovePartFromSequenceDialogFiller(os, "1..190950"));
3159 GTMenu::showContextMenu(os, GTUtilsMdi::activeWindow(os));
3160
3161 // 5. Call this dialog again, remove region (1..8999).
3162 // Expected state: UGENE doesn't crash.
3163 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_EDIT << ACTION_EDIT_REMOVE_SUBSEQUENCE));
3164 GTUtilsDialog::waitForDialog(os, new RemovePartFromSequenceDialogFiller(os, "1..8999"));
3165 GTMenu::showContextMenu(os, GTUtilsMdi::activeWindow(os));
3166 }
3167
GUI_TEST_CLASS_DEFINITION(test_2538)3168 GUI_TEST_CLASS_DEFINITION(test_2538) {
3169 // 1. Open file "_common_data/scenarios/tree_view/COI.nwk"
3170 GTFileDialog::openFile(os, dataDir + "/samples/Newick/", "COI.nwk");
3171 GTUtilsTaskTreeView::waitTaskFinished(os);
3172
3173 // 2. Call context menu on node just near root. Click "Collapse"
3174 GTMouseDriver::moveTo(GTUtilsPhyTree::getGlobalCenterCoord(os, GTUtilsPhyTree::getNodes(os).at(1)));
3175 GTMouseDriver::click();
3176
3177 QWidget *treeView = GTWidget::findWidget(os, "treeView");
3178
3179 const QImage initImg = GTWidget::getImage(os, treeView);
3180
3181 GTMouseDriver::doubleClick();
3182
3183 // 3. Call context menu on node just near root. Click "Expand"
3184 GTMouseDriver::doubleClick();
3185
3186 // Expected state: tree has the same view as at the beginning
3187 const QImage finalImg = GTWidget::getImage(os, treeView);
3188
3189 // images have several pixels differ. so sizes are compared
3190 CHECK_SET_ERR(initImg.size() == finalImg.size(), "different images");
3191 }
3192
GUI_TEST_CLASS_DEFINITION(test_2540)3193 GUI_TEST_CLASS_DEFINITION(test_2540) {
3194 // 1. Forbid to write to the dir with the source bam(sam) file.
3195 QDir().mkpath(sandBoxDir + "test_2540");
3196 GTFile::copy(os, testDir + "_common_data/bam/chrM.sorted.bam", sandBoxDir + "test_2540/chrM.sorted.bam");
3197 GTFile::setReadOnly(os, sandBoxDir + "test_2540");
3198 // 2. Try to open this file with UGENE.
3199 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "chrM.sorted.bam.ugenedb"));
3200 GTFileDialog::openFile(os, sandBoxDir + "test_2540/chrM.sorted.bam");
3201 GTUtilsTaskTreeView::waitTaskFinished(os);
3202 GTUtilsTaskTreeView::waitTaskFinished(os);
3203 // Expected state: an import dialog appeared.
3204 // 3. Set the destination location with enough permissions.
3205 // 4. Click "Import" button.
3206 // Expected state: file is successfully imported.
3207 }
3208
GUI_TEST_CLASS_DEFINITION(test_2542)3209 GUI_TEST_CLASS_DEFINITION(test_2542) {
3210 // 1. Open "data/samples/CLUSTALW/COI.aln".
3211 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
3212 GTUtilsTaskTreeView::waitTaskFinished(os);
3213
3214 // 2. Lock the document
3215 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "action_document_lock"));
3216 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "COI.aln"));
3217 GTMouseDriver::click(Qt::RightButton);
3218
3219 // 3. Do pairwise alignment with any sequences.
3220 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(0, 0), QPoint(1, 1));
3221 GTWidget::click(os, GTWidget::findWidget(os, "OP_PAIRALIGN"));
3222 GTWidget::click(os, GTWidget::findWidget(os, "ArrowHeader_Output settings"));
3223
3224 QCheckBox *check = qobject_cast<QCheckBox *>(GTWidget::findWidget(os, "inNewWindowCheckBox"));
3225 CHECK_SET_ERR(check != nullptr, "inNewWindowCheckBox not found!");
3226 GTCheckBox::setChecked(os, check, false);
3227
3228 // State:
3229 // Align button not active if file locked for writing (user locking or format didn't support writing) and selected aligning in current file option
3230 QWidget *button = GTWidget::findWidget(os, "alignButton");
3231
3232 CHECK_SET_ERR(!button->isEnabled(), "Align button is enabled");
3233 }
3234
GUI_TEST_CLASS_DEFINITION(test_2543)3235 GUI_TEST_CLASS_DEFINITION(test_2543) {
3236 class BuildTreeDialogFiller_test_2543 : public Filler {
3237 public:
3238 BuildTreeDialogFiller_test_2543(HI::GUITestOpStatus &os, QString _saveTree = "default")
3239 : Filler(os, "CreatePhyTree"),
3240 saveTree(_saveTree) {
3241 }
3242 virtual void run() {
3243 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3244 if (saveTree != "default") {
3245 QLineEdit *saveLineEdit = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "fileNameEdit"));
3246 GTLineEdit::setText(os, saveLineEdit, saveTree);
3247 }
3248
3249 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new LicenseAgreementDialogFiller(os));
3250 // Expected state: UGENE does not allow to create tree, the message dialog appears
3251 GTUtilsNotifications::waitForNotification(os, true);
3252
3253 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
3254 }
3255
3256 private:
3257 QString saveTree;
3258 };
3259
3260 // 1. Open "samples/CLUSTALW/COI.aln".
3261 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
3262 GTUtilsTaskTreeView::waitTaskFinished(os);
3263
3264 // 2. Click the "Build tree" button on the toolbar.
3265 // Expected state: a "Build Phylogenetic Tree" dialog appeared.
3266 // 3. Set the output file location to any read-only folder.
3267 const QString outputFilePath = testDir + "_common_data/scenarios/sandbox/gui_regr_2543";
3268 QDir sandboxDir(testDir + "_common_data/scenarios/sandbox");
3269 sandboxDir.mkdir("gui_regr_2543");
3270 GTFile::setReadOnly(os, outputFilePath);
3271
3272 GTUtilsDialog::waitForDialog(os, new BuildTreeDialogFiller_test_2543(os, outputFilePath + "/test.nwk"));
3273
3274 QAbstractButton *tree = GTAction::button(os, "Build Tree");
3275 GTWidget::click(os, tree);
3276 GTUtilsTaskTreeView::waitTaskFinished(os);
3277 }
3278
GUI_TEST_CLASS_DEFINITION(test_2544)3279 GUI_TEST_CLASS_DEFINITION(test_2544) {
3280 // 1. Open "data/samples/FASTA/human_T1.fa"
3281 GTFile::copy(os, dataDir + "samples/FASTA/human_T1.fa", sandBoxDir + "test_2544.fa");
3282 GTFileDialog::openFile(os, sandBoxDir + "test_2544.fa");
3283 GTUtilsSequenceView::checkSequenceViewWindowIsActive(os);
3284
3285 // 2. Use context menu { Edit sequence -> Remove subsequence... }
3286 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_EDIT << "action_edit_remove_sub_sequences"));
3287 GTUtilsDialog::waitForDialog(os, new RemovePartFromSequenceDialogFiller(os, "10..20"));
3288 GTMenu::showContextMenu(os, GTUtilsSequenceView::getPanOrDetView(os));
3289
3290 // Expected state: "Remove subsequence" dialog has appeared
3291 // 3. Set string "10..20" to the "Region to remove" field, press the "Remove" button
3292 // Expected state: the dialog has disappeared, subsequence has been removed
3293
3294 // 4. Change permissions to the file to read-only
3295 GTFile::setReadOnly(os, sandBoxDir + "test_2544.fa");
3296 // 5. Use context menu on the document item in project view { Save selected documents }
3297
3298 // Expected state: message box has appeared
3299 // 6. Press "Save" button
3300 // Expected state: "Save as" dialog has appeared
3301 // 7. Choose the same file, press "Save"
3302 // Expected state: message box has appeared
3303 // 8. Press "Save"
3304
3305 class InnerMessageBoxFiller : public MessageBoxDialogFiller {
3306 public:
3307 InnerMessageBoxFiller(HI::GUITestOpStatus &os)
3308 : MessageBoxDialogFiller(os, QMessageBox::Yes) {
3309 }
3310 void run() {
3311 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Cancel, "", "permissionBox"));
3312 MessageBoxDialogFiller::run();
3313 }
3314 };
3315 class CustomSaver : public GTFileDialogUtils {
3316 public:
3317 CustomSaver(HI::GUITestOpStatus &os)
3318 : GTFileDialogUtils(os, sandBoxDir, "test_2544.fa", GTFileDialogUtils::Save) {
3319 }
3320 void commonScenario() {
3321 fileDialog = GTWidget::getActiveModalWidget(os);
3322 GTUtilsDialog::waitForDialog(os, new InnerMessageBoxFiller(os));
3323 setName();
3324 clickButton(button);
3325 }
3326 };
3327 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ACTION_PROJECT__SAVE_DOCUMENT));
3328 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Save, "", "permissionBox"));
3329 GTUtilsDialog::waitForDialog(os, new CustomSaver(os));
3330 GTUtilsProjectTreeView::click(os, "test_2544.fa", Qt::RightButton);
3331 GTUtilsDialog::waitAllFinished(os);
3332 }
3333
GUI_TEST_CLASS_DEFINITION(test_2545)3334 GUI_TEST_CLASS_DEFINITION(test_2545) {
3335 // 1. Remove the "spidey" external tool, if it exists.
3336 GTUtilsExternalTools::removeTool(os, "Spidey");
3337
3338 // 2. Open "human_t1.fa".
3339 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
3340 GTUtilsTaskTreeView::waitTaskFinished(os);
3341
3342 // 3. Call context menu, select the {Align -> Align sequence to mRna} menu item.
3343 // Expected state: UGENE offers to select the "spidey" external tool.
3344 // 4. Refuse the offering.
3345 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::No));
3346 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "ADV_MENU_ALIGN"
3347 << "Align sequence to mRNA"));
3348 GTMenu::showContextMenu(os, GTUtilsMdi::activeWindow(os));
3349
3350 // Expected state: align task is cancelled.
3351 CHECK_SET_ERR(0 == GTUtilsTaskTreeView::getTopLevelTasksCount(os), "The task is not canceled");
3352 }
3353
GUI_TEST_CLASS_DEFINITION(test_2549)3354 GUI_TEST_CLASS_DEFINITION(test_2549) {
3355 // this needed to ensure that log view has text
3356 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/gtf/invalid", "AB375112_annotations.gtf"));
3357 GTUtilsDialog::waitForDialog(os, new DocumentFormatSelectorDialogFiller(os, "GTF"));
3358 GTMenu::clickMainMenuItem(os, QStringList() << "File"
3359 << "Open as...");
3360
3361 GTKeyboardDriver::keyClick('3', Qt::AltModifier);
3362 GTWidget::click(os, GTWidget::findWidget(os, "dock_log_view"));
3363 GTKeyboardDriver::keySequence("this sequence needed to ensure that log view has text");
3364
3365 GTKeyboardDriver::keyClick('a', Qt::ControlModifier);
3366 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
3367
3368 const QString clipboardContent = GTClipboard::text(os);
3369 CHECK_SET_ERR(!clipboardContent.isEmpty(), "Clipboard is empty");
3370 }
3371
GUI_TEST_CLASS_DEFINITION(test_2565)3372 GUI_TEST_CLASS_DEFINITION(test_2565) {
3373 // 1. Open "samples/Genbank/murine.gb".
3374 // 2. Press Ctrl+F.
3375 // 3. Insert the pattern "GCTAGCTTAAGTAACGCCACTTTT".
3376 // 4. Click "Search".
3377 // Expected: the pattern is not found. Notification with this information appears.
3378 GTLogTracer l;
3379 GTFileDialog::openFile(os, dataDir + "samples/Genbank/", "murine.gb");
3380 GTUtilsTaskTreeView::waitTaskFinished(os);
3381 GTUtilsOptionsPanel::runFindPatternWithHotKey("GCTAGCTTAAGTAACGCCACTTTT", os);
3382 CHECK_SET_ERR(l.checkMessage(QString("Searching patterns in sequence task: No results found.")),
3383 "No expected message in the log");
3384 }
3385
GUI_TEST_CLASS_DEFINITION(test_2566)3386 GUI_TEST_CLASS_DEFINITION(test_2566) {
3387 // 1. Open "samples/Genbank/murine.gb".
3388 GTLogTracer l;
3389 GTFileDialog::openFile(os, dataDir + "samples/Genbank/", "murine.gb");
3390 GTUtilsTaskTreeView::waitTaskFinished(os);
3391
3392 // 2. Press Ctrl+F.
3393 GTKeyboardDriver::keyClick('f', Qt::ControlModifier);
3394
3395 // 3. Enter the pattern: GCTAGCTTAAGTAACGCCAC
3396 QWidget *patternInputLine = QApplication::focusWidget();
3397 CHECK_SET_ERR(nullptr != patternInputLine && patternInputLine->objectName() == "textPattern", "Focus is not on FindPattern widget");
3398
3399 GTKeyboardDriver::keySequence("GCTAGCTTAAGTAACGCCAC");
3400
3401 // 4. Choose the algorithm: Substitute.
3402 GTUtilsOptionPanelSequenceView::setAlgorithm(os, "Substitute");
3403
3404 // 5. Enter the "Should match" value: 97%
3405 GTUtilsOptionPanelSequenceView::setMatchPercentage(os, 97);
3406
3407 // 6. Click "Search".
3408 // There is no "Search buttons since UGENE-3483 was done, the task is already launched
3409 GTUtilsTaskTreeView::waitTaskFinished(os);
3410
3411 // Expected: 97% is entered.
3412 const int matchPercentage = GTUtilsOptionPanelSequenceView::getMatchPercentage(os);
3413 CHECK_SET_ERR(97 == matchPercentage, "Entered and actual values don't match");
3414
3415 // Expected state: the task finished successfully.
3416 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
3417 }
3418
GUI_TEST_CLASS_DEFINITION(test_2567)3419 GUI_TEST_CLASS_DEFINITION(test_2567) {
3420 // 1. Open "samples/Genbank/murine.gb".
3421 GTLogTracer l;
3422 GTFileDialog::openFile(os, dataDir + "samples/Genbank/", "murine.gb");
3423 GTUtilsTaskTreeView::waitTaskFinished(os);
3424
3425 // 2. Press Ctrl+F.
3426 GTKeyboardDriver::keyClick('f', Qt::ControlModifier);
3427
3428 // 3. Enter the pattern: GCTAGCTTAAGTAACGCCAC
3429 QWidget *patternInputLine = QApplication::focusWidget();
3430 CHECK_SET_ERR(nullptr != patternInputLine && patternInputLine->objectName() == "textPattern", "Focus is not on FindPattern widget");
3431
3432 GTKeyboardDriver::keySequence("GCTAGCTTAAGTAACGCCAC");
3433
3434 // 4. Choose the algorithm: Substitute.
3435 GTUtilsOptionPanelSequenceView::setAlgorithm(os, "Substitute");
3436
3437 // 5. Enter the "Should match" value: 30%
3438 GTUtilsOptionPanelSequenceView::setMatchPercentage(os, 30);
3439
3440 // 6. Click "Search".
3441 // There is no "Search buttons since UGENE-3483 was done, the task is already launched
3442 GTUtilsTaskTreeView::waitTaskFinished(os);
3443
3444 // Expected state: the task finished successfully.
3445 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
3446 }
3447
GUI_TEST_CLASS_DEFINITION(test_2568)3448 GUI_TEST_CLASS_DEFINITION(test_2568) {
3449 // 1. Open WD
3450 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
3451 // 2. Add the "Call Variants" sample
3452 GTUtilsWorkflowDesigner::addSample(os, "call variants");
3453 GTKeyboardDriver::keyClick(Qt::Key_Escape);
3454 // 3. Run the wizard
3455
3456 class customFileDialog : public CustomScenario {
3457 public:
3458 void run(HI::GUITestOpStatus &os) {
3459 QWidget *d = GTWidget::getActiveModalWidget(os);
3460 QFileDialog *dialog = qobject_cast<QFileDialog *>(d);
3461 CHECK_SET_ERR(dialog, "activeModalWidget is not file dialog");
3462
3463 QString name = dialog->directory().dirName();
3464 CHECK_SET_ERR(name == "Assembly", "unexpectyed dir name: " + name);
3465 GTWidget::click(os, GTWidget::findButtonByText(os, "Cancel", dialog));
3466 }
3467 };
3468
3469 class customWizard : public CustomScenario {
3470 public:
3471 void run(HI::GUITestOpStatus &os) {
3472 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3473 // 4. Click to browse a reference file and choose a reference
3474 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, dataDir + "samples/Assembly/chrM.fa"));
3475 QWidget *browse = GTWidget::findWidget(os, "browseButton", GTWidget::findWidget(os, "Reference sequence file labeledWidget", dialog));
3476 GTWidget::click(os, browse);
3477 // Expected: the file is chosen. (The file's folder is DIR)
3478
3479 // 5. Click to browse a BAM/SAM file
3480
3481 // Expected: the open file dialog is opened with the folder DIR
3482 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, new customFileDialog()));
3483 GTWidget::click(os, GTWidget::findWidget(os, "addFileButton"));
3484
3485 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
3486 }
3487 };
3488
3489 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Call Variants Wizard", new customWizard()));
3490 GTWidget::click(os, GTAction::button(os, "Show wizard"));
3491 }
3492
GUI_TEST_CLASS_DEFINITION(test_2569)3493 GUI_TEST_CLASS_DEFINITION(test_2569) {
3494 // 1. Open WD.
3495 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
3496 // 2. Add the Call Variants sample.
3497 GTUtilsWorkflowDesigner::addSample(os, "Call variants");
3498 GTKeyboardDriver::keyClick(Qt::Key_Escape);
3499 // 3. Set valid input data.
3500 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Assembly (BAM/SAM)"));
3501 GTMouseDriver::click();
3502 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/bam/chrM.sorted.bam");
3503
3504 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
3505 GTMouseDriver::click();
3506 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cmdline/call-variations/chrM.fa");
3507 GTUtilsWorkflowDesigner::runWorkflow(os);
3508 GTUtilsTaskTreeView::waitTaskFinished(os);
3509 // 4. Click "External Tools" on the appeared Dashboard.
3510 GTUtilsDashboard::openTab(os, GTUtilsDashboard::ExternalTools);
3511 // 5. Expand "SAMtools run"
3512 auto runNode = GTUtilsDashboard::getExternalToolNodeByText(os, "SAMtools run");
3513 GTUtilsDashboard::clickNodeTitle(os, runNode);
3514 // 6. Check that "Command" node exists.
3515 GTUtilsDashboard::getExternalToolNodeByText(os, runNode, "Command");
3516 }
3517
GUI_TEST_CLASS_DEFINITION(test_2577)3518 GUI_TEST_CLASS_DEFINITION(test_2577) {
3519 // 1. Open {data/samples/CLUSTALW/COI.aln}.
3520 GTLogTracer l;
3521 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
3522 GTUtilsTaskTreeView::waitTaskFinished(os);
3523
3524 // 2. Call context menu somewhere on the alignment, select {Consenssus mode...} menu item.
3525 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Consensus mode", GTGlobals::UseMouse));
3526 GTMenu::showContextMenu(os, GTUtilsMdi::activeWindow(os));
3527
3528 // Expected state: options panel "General" tab opens.
3529 QWidget *panel = GTWidget::findWidget(os, "OP_MSA_GENERAL");
3530 CHECK_SET_ERR(nullptr != panel, "General OP tab does not appear");
3531 }
3532
GUI_TEST_CLASS_DEFINITION(test_2578)3533 GUI_TEST_CLASS_DEFINITION(test_2578) {
3534 // 1. Open {data/samples/CLUSTALW/COI.aln}.
3535 GTFileDialog::openFile(os, dataDir + "/samples/CLUSTALW/", "COI.aln");
3536 GTUtilsTaskTreeView::waitTaskFinished(os);
3537
3538 // 2. Open options panel 'Highlighting' tab.
3539 GTWidget::click(os, GTWidget::findWidget(os, "OP_MSA_HIGHLIGHTING"));
3540
3541 // 3. Select 'agreements' highlighting scheme.
3542 QComboBox *combo = qobject_cast<QComboBox *>(GTWidget::findWidget(os, "highlightingScheme"));
3543 CHECK_SET_ERR(combo != nullptr, "highlightingScheme not found!");
3544 GTComboBox::selectItemByText(os, combo, "Agreements");
3545
3546 QWidget *exportButton = GTWidget::findWidget(os, "exportHighlightning");
3547 CHECK_SET_ERR(nullptr != exportButton, "exportButton not found");
3548 CHECK_SET_ERR(!exportButton->isEnabled(), "exportButton is enabled unexpectedly");
3549
3550 // 4. Select any reference sequence.
3551 // Expected state: the "Export" button is active.
3552 GTWidget::click(os, GTWidget::findWidget(os, "sequenceLineEdit"));
3553 GTKeyboardDriver::keySequence("Montana_montana");
3554 GTKeyboardDriver::keyClick(Qt::Key_Enter);
3555 CHECK_SET_ERR(exportButton->isEnabled(), "exportButton is disabled unexpectedly");
3556
3557 // 5. Select 'General' tab, then select 'Highlighting' tab again.
3558 // Expected state: the "Export" button is active.
3559 GTWidget::click(os, GTWidget::findWidget(os, "OP_MSA_GENERAL"));
3560 GTWidget::click(os, GTWidget::findWidget(os, "OP_MSA_HIGHLIGHTING"));
3561
3562 exportButton = GTWidget::findWidget(os, "exportHighlightning");
3563 CHECK_SET_ERR(nullptr != exportButton, "exportButton not found");
3564 CHECK_SET_ERR(exportButton->isEnabled(), "exportButton is disabled unexpectedly");
3565 }
3566
GUI_TEST_CLASS_DEFINITION(test_2579)3567 GUI_TEST_CLASS_DEFINITION(test_2579) {
3568 // Linux:
3569 // 1. Click the menu Settings -> Preferences -> External Tools.
3570 // 2. Find the MAFFT item and if it has the active red cross, click it.
3571 // 3. Click the MAFFT's browse button and add the MAFFT executable from UGENE external tools package.
3572 // Expected: there are no errors in the log.
3573
3574 class MafftInactivation : public CustomScenario {
3575 public:
3576 void run(HI::GUITestOpStatus &os) {
3577 QString path = AppSettingsDialogFiller::getExternalToolPath(os, "MAFFT");
3578 AppSettingsDialogFiller::clearToolPath(os, "MAFFT");
3579 AppSettingsDialogFiller::setExternalToolPath(os, "MAFFT", path);
3580
3581 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3582 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
3583 }
3584 };
3585
3586 GTLogTracer l;
3587
3588 GTUtilsDialog::waitForDialog(os, new AppSettingsDialogFiller(os, new MafftInactivation()));
3589 GTMenu::clickMainMenuItem(os, QStringList() << "Settings"
3590 << "Preferences...");
3591 GTUtilsLog::check(os, l);
3592 }
GUI_TEST_CLASS_DEFINITION(test_2581)3593 GUI_TEST_CLASS_DEFINITION(test_2581) {
3594 // 1. Open file "_common_data/scenarios/msa/ma2_gapped_same_names.aln"
3595 // 2. Use context menu { Align -> Align with MUSCLE }
3596 // Expected state: the "Align with MUSCLE" dialog has appeared
3597 // 3. Press the "Align" button
3598 // Expected state: after a few seconds alignment has finished, UGENE does not crash
3599 GTLogTracer l;
3600
3601 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa/", "ma2_gapped_same_names.aln");
3602 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
3603
3604 GTUtilsDialog::waitForDialog(os, new MuscleDialogFiller(os, MuscleDialogFiller::Default));
3605 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with muscle"));
3606
3607 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(0, 0));
3608 GTMouseDriver::click(Qt::RightButton);
3609
3610 GTUtilsTaskTreeView::waitTaskFinished(os);
3611 GTUtilsLog::check(os, l);
3612 }
3613
GUI_TEST_CLASS_DEFINITION(test_2581_1)3614 GUI_TEST_CLASS_DEFINITION(test_2581_1) {
3615 // 1. Open file "_common_data/scenarios/msa/ma2_gapped_same_names.aln"
3616 // 2. Use context menu { Align -> Align with ClustalW }
3617 // Expected state: the "Align with ClustalW" dialog has appeared
3618 // 3. Press the "Align" button
3619 // Expected state: after a few seconds alignment has finished, UGENE does not crash
3620
3621 GTLogTracer l;
3622
3623 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa/", "ma2_gapped_same_names.aln");
3624 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
3625
3626 GTUtilsDialog::waitForDialog(os, new ClustalWDialogFiller(os));
3627 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with ClustalW", GTGlobals::UseMouse));
3628
3629 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(0, 0));
3630 GTMouseDriver::click(Qt::RightButton);
3631
3632 GTUtilsTaskTreeView::waitTaskFinished(os);
3633 GTUtilsLog::check(os, l);
3634 }
3635
GUI_TEST_CLASS_DEFINITION(test_2581_2)3636 GUI_TEST_CLASS_DEFINITION(test_2581_2) {
3637 // 1. Open file "_common_data/scenarios/msa/ma2_gapped_same_names.aln"
3638 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma2_gapped_same_names.aln");
3639 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
3640
3641 // 2. Use context menu { Align -> Align with ClustalO }
3642 // Expected state: the "Align with Clustal Omega" dialog has appeared
3643
3644 // 3. Press the "Align" button
3645 // Expected state: after a few seconds alignment has finished, UGENE does not crash
3646 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Align"
3647 << "Align with ClustalO..."));
3648 GTUtilsDialog::waitForDialog(os, new ClustalOSupportRunDialogFiller(os));
3649 GTWidget::click(os, GTUtilsMSAEditorSequenceArea::getSequenceArea(os), Qt::RightButton);
3650
3651 GTUtilsTaskTreeView::waitTaskFinished(os);
3652 }
3653
GUI_TEST_CLASS_DEFINITION(test_2581_3)3654 GUI_TEST_CLASS_DEFINITION(test_2581_3) {
3655 // 1. Open file "_common_data/scenarios/msa/ma2_gapped_same_names.aln"
3656 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa", "ma2_gapped_same_names.aln");
3657 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
3658
3659 // 2. Use context menu { Align -> Align with MAFFT }
3660 // Expected state: the "Align with MAFFT" dialog has appeared
3661
3662 // 3. Press the "Align" button
3663 // Expected state: after a few seconds alignment has finished, UGENE does not crash
3664 MAFFTSupportRunDialogFiller::Parameters parameters;
3665 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Align"
3666 << "Align with MAFFT..."));
3667 GTUtilsDialog::waitForDialog(os, new MAFFTSupportRunDialogFiller(os, ¶meters));
3668 GTWidget::click(os, GTUtilsMSAEditorSequenceArea::getSequenceArea(os), Qt::RightButton);
3669
3670 GTUtilsTaskTreeView::waitTaskFinished(os);
3671 }
3672
GUI_TEST_CLASS_DEFINITION(test_2581_4)3673 GUI_TEST_CLASS_DEFINITION(test_2581_4) {
3674 // 1. Open file "_common_data/scenarios/msa/ma2_gapped_same_names.aln"
3675 // 2. Use context menu { Align -> Align with T-Coffee }
3676 // Expected state: the "Align with T-Coffee" dialog has appeared
3677 // 3. Press the "Align" button
3678 // Expected state: after a few seconds alignment has finished, UGENE does not crash
3679
3680 GTLogTracer l;
3681
3682 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa/", "ma2_gapped_same_names.aln");
3683 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
3684
3685 GTUtilsDialog::waitForDialog(os, new TCoffeeDailogFiller(os));
3686 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with T-Coffee", GTGlobals::UseMouse));
3687
3688 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(0, 0));
3689 GTMouseDriver::click(Qt::RightButton);
3690
3691 GTUtilsTaskTreeView::waitTaskFinished(os);
3692 GTUtilsLog::check(os, l);
3693 }
3694
GUI_TEST_CLASS_DEFINITION(test_2581_5)3695 GUI_TEST_CLASS_DEFINITION(test_2581_5) {
3696 // 1. Open file "_common_data/scenarios/msa/ma2_gapped_same_names.aln"
3697 // 2. Use context menu { Align -> Align with Kalign }
3698 // Expected state: the "Align with Kalign" dialog has appeared
3699 // 3. Press the "Align" button
3700 // Expected state: after a few seconds alignment has finished, UGENE does not crash
3701
3702 GTLogTracer l;
3703
3704 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/msa/", "ma2_gapped_same_names.aln");
3705 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
3706
3707 GTUtilsDialog::waitForDialog(os, new KalignDialogFiller(os));
3708 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "align_with_kalign", GTGlobals::UseMouse));
3709
3710 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(0, 0));
3711 GTMouseDriver::click(Qt::RightButton);
3712
3713 GTUtilsTaskTreeView::waitTaskFinished(os);
3714 GTUtilsLog::check(os, l);
3715 }
3716
GUI_TEST_CLASS_DEFINITION(test_2583)3717 GUI_TEST_CLASS_DEFINITION(test_2583) {
3718 // 1. Open file data/samples/EMBL/AL000263.emb
3719 GTFileDialog::openFile(os, dataDir + "samples/EMBL/AL000263.emb");
3720 GTUtilsTaskTreeView::waitTaskFinished(os);
3721 // 2. Open file test/_common_data/regression/2583/My_Document_2.gb
3722 GTFileDialog::openFile(os, testDir + "_common_data/regression/2583/MyDocument_2.gb");
3723 GTUtilsTaskTreeView::waitTaskFinished(os);
3724 // 3. Drag "AB000263 standart annotations" AL000263.emb sequence view
3725 QModelIndex idx = GTUtilsProjectTreeView::findIndex(os, "AB000263 standard annotations");
3726 QWidget *sequence = GTUtilsSequenceView::getSeqWidgetByNumber(os);
3727 CHECK_SET_ERR(sequence != nullptr, "Sequence widget not found");
3728
3729 GTUtilsDialog::waitForDialog(os, new CreateObjectRelationDialogFiller(os));
3730 GTUtilsProjectTreeView::dragAndDrop(os, idx, sequence);
3731 // "Edit objct relations" dialog appeared. Click "OK"
3732 // 4. Select all "blast result" tree items in annotation tree view
3733 QList<QTreeWidgetItem *> blastResultItems = GTUtilsAnnotationsTreeView::findItems(os, "blast result");
3734 GTUtilsAnnotationsTreeView::selectItems(os, blastResultItems);
3735 // 5. Use context menu: "Export"->"Export BLAST result to alignment"
3736
3737 GTUtilsDialog::waitForDialog(os, new ExportBlastResultDialogFiller(os, sandBoxDir + "test_2583/test_2583.aln", true));
3738 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "ADV_MENU_EXPORT"
3739 << "export_BLAST_result_to_alignment"));
3740 GTMouseDriver::click(Qt::RightButton);
3741 // "Export BLAST result to alignment" dialog appeared. Set some output file.
3742 // check "add reference to alignment" checkBox
3743 // Click "Export"
3744 // Expected state: aligned parts are different with same parts in ref sequence.//Kirill can give more comments
3745 GTUtilsProjectTreeView::openView(os);
3746 GTUtilsProjectTreeView::toggleView(os);
3747 GTUtilsMSAEditorSequenceArea::checkSelection(os, QPoint(30, 1), QPoint(41, 1), "TGCGGCTGCTCT");
3748 }
3749
GUI_TEST_CLASS_DEFINITION(test_2605)3750 GUI_TEST_CLASS_DEFINITION(test_2605) {
3751 GTLogTracer logTracer;
3752 // 1. Open file _common_data/fasta/multy_fa.fa as multiple alignment
3753 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Join));
3754 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/multy_fa.fa");
3755 GTUtilsTaskTreeView::waitTaskFinished(os);
3756 // 2. Export subalignment from this msa to any MSA format
3757 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EXPORT << "Save subalignment"));
3758 GTUtilsDialog::waitForDialog(os, new ExtractSelectedAsMSADialogFiller(os, testDir + "_common_data/scenarios/sandbox/2605.aln", QStringList() << "SEQUENCE_1", 6, 237));
3759 GTMenu::showContextMenu(os, GTWidget::findWidget(os, "msa_editor_sequence_area"));
3760
3761 // Expected state: export successfull, no any messages in log like "There is no sequence objects in given file, unable to convert it in multiple alignment"
3762 CHECK_SET_ERR(!logTracer.hasErrors(), "Errors in log: " + logTracer.getJoinedErrorString());
3763 }
3764
GUI_TEST_CLASS_DEFINITION(test_2612)3765 GUI_TEST_CLASS_DEFINITION(test_2612) {
3766 // 1. Open sequence "samples/fasta/human_T1.fa".
3767 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
3768 GTUtilsTaskTreeView::waitTaskFinished(os);
3769 // 2. Search for 20 first nucleotides (TTGTCAGATTCACCAAAGTT) using Find Pattern.
3770 GTUtilsOptionsPanel::runFindPatternWithHotKey("TTGTCAGATTCACCAAAGTT", os);
3771 GTWidget::click(os, GTWidget::findWidget(os, "getAnnotationsPushButton"));
3772 // Expected state: the annotation with pattern created and shown in sequence view.
3773 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "Annotations"));
3774 QTreeWidgetItem *item = GTUtilsAnnotationsTreeView::findItem(os, "Misc. Feature");
3775 GTMouseDriver::moveTo(GTTreeWidget::getItemCenter(os, item));
3776 // 3. Delete annotation from annotation editor.
3777 GTMouseDriver::click();
3778 GTKeyboardDriver::keyClick(Qt::Key_Delete);
3779 // Expected state: there is no annotation in sequence view.
3780 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::findItem(os, "Misc. Feature", GTGlobals::FindOptions(false)) == nullptr, "Annotations document not deleted");
3781 }
3782
GUI_TEST_CLASS_DEFINITION(test_2619)3783 GUI_TEST_CLASS_DEFINITION(test_2619) {
3784 // 1. Open file samples/genbank/sars.gb
3785 GTFileDialog::openFile(os, dataDir + "samples/Genbank", "sars.gb");
3786 GTUtilsTaskTreeView::waitTaskFinished(os);
3787
3788 // 2. Open context menu for any qualifier on annotation table view.
3789 // Expected state: submenu "Copy" didn't contains items "Edit qualifier" and "Add 'evidence' column"
3790 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << ADV_MENU_COPY << "edit_qualifier_action", PopupChecker::NotExists));
3791 GTUtilsAnnotationsTreeView::callContextMenuOnQualifier(os, "5'UTR", "evidence");
3792
3793 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << ADV_MENU_COPY << "toggle_column", PopupChecker::NotExists));
3794 GTUtilsAnnotationsTreeView::callContextMenuOnQualifier(os, "5'UTR", "evidence");
3795 }
3796
GUI_TEST_CLASS_DEFINITION(test_2622)3797 GUI_TEST_CLASS_DEFINITION(test_2622) {
3798 // 1. Open "_common_data/fasta/multy_fa.fa".
3799 // 2. Choose "Merge sequences ..." with 100 bases.
3800 GTLogTracer l;
3801
3802 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Merge, 100));
3803 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/multy_fa.fa");
3804 GTUtilsTaskTreeView::waitTaskFinished(os);
3805
3806 // 3. Press Ctrl + F.
3807 GTKeyboardDriver::keyClick('f', Qt::ControlModifier);
3808
3809 // 4. Choose "Regular expression" algorithm.
3810 GTUtilsOptionPanelSequenceView::setAlgorithm(os, "Regular expression");
3811
3812 // 5. Write "X+" in the pattern string.
3813 QWidget *textPattern = GTWidget::findWidget(os, "textPattern");
3814 GTWidget::click(os, textPattern);
3815 GTKeyboardDriver::keyClick('X');
3816 GTKeyboardDriver::keyClick('=', Qt::ShiftModifier);
3817
3818 // UGENE does not hang.
3819 GTUtilsTaskTreeView::waitTaskFinished(os);
3820 GTUtilsLog::check(os, l);
3821 }
3822
GUI_TEST_CLASS_DEFINITION(test_2622_1)3823 GUI_TEST_CLASS_DEFINITION(test_2622_1) {
3824 // 1. Open "_common_data/fasta/multy_fa.fa".
3825 // 2. Choose "Merge sequences ..." with 100 bases.
3826 GTLogTracer l;
3827
3828 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Merge, 100));
3829 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/multy_fa.fa");
3830 GTUtilsTaskTreeView::waitTaskFinished(os);
3831
3832 // 3. Press Ctrl + F.
3833 GTKeyboardDriver::keyClick('f', Qt::ControlModifier);
3834
3835 // 4. Choose "Regular expression" algorithm.
3836 GTUtilsOptionPanelSequenceView::setAlgorithm(os, "Regular expression");
3837
3838 // 5. Write "X+" in the pattern string.
3839 QWidget *textPattern = GTWidget::findWidget(os, "textPattern");
3840 GTWidget::click(os, textPattern);
3841 GTKeyboardDriver::keyClick('X');
3842 GTKeyboardDriver::keyClick('=', Qt::ShiftModifier);
3843
3844 // 6. Check "Results no longer than" and set the value 1.
3845 QCheckBox *boxUseMaxResultLen = qobject_cast<QCheckBox *>(GTWidget::findWidget(os, "boxUseMaxResultLen"));
3846 GTCheckBox::setChecked(os, boxUseMaxResultLen, true);
3847
3848 QSpinBox *boxMaxResultLen = qobject_cast<QSpinBox *>(GTWidget::findWidget(os, "boxMaxResultLen"));
3849 GTSpinBox::setValue(os, boxMaxResultLen, 1, GTGlobals::UseKeyBoard);
3850
3851 // UGENE does not hang and all results are 1 bp length (100 results).
3852 GTUtilsTaskTreeView::waitTaskFinished(os);
3853 GTUtilsLog::check(os, l);
3854
3855 QLabel *resultLabel = qobject_cast<QLabel *>(GTWidget::findWidget(os, "resultLabel"));
3856 CHECK_SET_ERR(resultLabel->text() == "Results: 1/100", "Unexpected find algorithm results");
3857 }
3858
GUI_TEST_CLASS_DEFINITION(test_2632)3859 GUI_TEST_CLASS_DEFINITION(test_2632) {
3860 // 1. Opened the full tuxedo wizard
3861 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
3862
3863 class custom : public CustomScenario {
3864 public:
3865 void run(HI::GUITestOpStatus &os) {
3866 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3867 // 2. Go to the second page
3868 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
3869 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
3870
3871 // 3. Set bowtie index and a known transcript file.
3872 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/bowtie/index/e_coli.1.ebwt"));
3873 GTWidget::click(os, GTWidget::findButtonByText(os, "Select\nbowtie index file", dialog));
3874 GTUtilsWizard::setParameter(os, "Known transcript file", QVariant(QDir().absoluteFilePath(testDir + "_common_data/gtf/valid.gtf")));
3875
3876 // 4. Revern to first page, then click next again
3877 // UGENE crashes
3878 GTUtilsWizard::clickButton(os, GTUtilsWizard::Back);
3879 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
3880
3881 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
3882 }
3883 };
3884 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Tuxedo Workflow", QStringList() << "Full"
3885 << "Single-end"));
3886 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Tuxedo Wizard", new custom()));
3887 GTUtilsWorkflowDesigner::addSample(os, "RNA-seq analysis with Tuxedo tools");
3888 }
3889
GUI_TEST_CLASS_DEFINITION(test_2638)3890 GUI_TEST_CLASS_DEFINITION(test_2638) {
3891 // 1. Open WD
3892 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
3893 // 2. Select "tuxedo" sample
3894 // 3. Set proper input data.
3895 QMap<QString, QVariant> map;
3896 map.insert("Bowtie index folder", QDir().absoluteFilePath(testDir + "_common_data/bowtie/index"));
3897 map.insert("Bowtie index basename", "e_coli");
3898 map.insert("Bowtie version", "Bowtie1");
3899 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Tuxedo Wizard", QList<QStringList>() << (QStringList() << testDir + "_common_data/e_coli/e_coli_1000.fastq"), map));
3900 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Tuxedo Workflow", QStringList() << "Single-sample"
3901 << "Single-end"));
3902 GTUtilsWorkflowDesigner::addSample(os, "RNA-seq analysis with Tuxedo tools");
3903
3904 GTUtilsWorkflowDesigner::click(os, "Assemble Transcripts with Cufflinks");
3905 GTKeyboardDriver::keyClick(Qt::Key_Delete);
3906
3907 // Launch the pipeline.
3908 GTUtilsWorkflowDesigner::runWorkflow(os);
3909 GTUtilsTaskTreeView::waitTaskFinished(os);
3910
3911 // 4. Open "input" tab on the dashboard
3912 GTUtilsDashboard::openTab(os, GTUtilsDashboard::Input);
3913 QWidget *indexButton = GTWidget::findButtonByText(os, "index", GTUtilsDashboard::getDashboard(os));
3914 QString type = indexButton->property("file-url").toString().split("\n")[0];
3915 CHECK_SET_ERR(type == "file", "Unexpected action type, expected file, got: " + type);
3916 }
3917
GUI_TEST_CLASS_DEFINITION(test_2640)3918 GUI_TEST_CLASS_DEFINITION(test_2640) {
3919 // 0. Set CPU optimisation in settings dialog
3920 class UpdateCPUCountScenario : public CustomScenario {
3921 public:
3922 void run(HI::GUITestOpStatus &os) {
3923 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3924 AppSettingsDialogFiller::openTab(os, AppSettingsDialogFiller::Resourses);
3925 QSpinBox *cpuBox = GTWidget::findExactWidget<QSpinBox *>(os, "cpuBox", dialog);
3926 GTSpinBox::setValue(os, cpuBox, 94, GTGlobals::UseKeyBoard);
3927 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
3928 }
3929 };
3930 GTUtilsDialog::waitForDialog(os, new AppSettingsDialogFiller(os, new UpdateCPUCountScenario));
3931 GTMenu::clickMainMenuItem(os, QStringList() << "Settings"
3932 << "Preferences...");
3933 // 1. Open WD
3934 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
3935 // 2. Select "tuxedo" sample
3936 // 3. Set proper input data
3937 QString expected = "tophat2/tophat -p 94 --output-dir";
3938
3939 GTLogTracer logTracer(expected);
3940 QMap<QString, QVariant> map;
3941 map.insert("Bowtie index folder", QDir().absoluteFilePath(testDir + "_common_data/bowtie/index"));
3942 map.insert("Bowtie index basename", "e_coli");
3943 map.insert("Bowtie version", "Bowtie1");
3944 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Tuxedo Wizard", QList<QStringList>() << (QStringList() << testDir + "_common_data/e_coli/e_coli_1000.fastq"), map));
3945 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Tuxedo Workflow", QStringList() << "Single-sample"
3946 << "Single-end"));
3947 GTUtilsWorkflowDesigner::addSample(os, "RNA-seq analysis with Tuxedo tools");
3948 GTUtilsWorkflowDesigner::click(os, "Assemble Transcripts with Cufflinks");
3949 GTKeyboardDriver::keyClick(Qt::Key_Delete);
3950
3951 // Launch pipeline
3952 GTUtilsWorkflowDesigner::runWorkflow(os);
3953 GTUtilsTaskTreeView::waitTaskFinished(os);
3954 // Expected state: tophat launched with argument -p
3955 GTUtilsLog::checkContainsMessage(os, logTracer);
3956 }
3957
GUI_TEST_CLASS_DEFINITION(test_2651)3958 GUI_TEST_CLASS_DEFINITION(test_2651) {
3959 // 1. File->Search NCBI GenBank...
3960 // 2. In the search field paste
3961 // AB797204.1 AB797210.1 AB797201.1
3962 // 3. Click Search
3963 // 4. Select three results and download them
3964 // 5. Close the dialog
3965 GTLogTracer l;
3966
3967 QList<int> resultNumbersToSelect;
3968 resultNumbersToSelect << 0 << 1 << 2;
3969 const QVariant variantNumbers = QVariant::fromValue<QList<int>>(resultNumbersToSelect);
3970 const QVariant searchField = QVariant::fromValue<QPair<int, QString>>(QPair<int, QString>(0, "AB797204.1 AB797210.1 AB797201.1"));
3971
3972 QList<DownloadRemoteFileDialogFiller::Action> remoteDialogActions;
3973 remoteDialogActions << DownloadRemoteFileDialogFiller::Action(DownloadRemoteFileDialogFiller::ClickOk, QVariant());
3974 const QVariant remoteDialogActionsVariant = QVariant::fromValue<QList<DownloadRemoteFileDialogFiller::Action>>(remoteDialogActions);
3975
3976 QList<NcbiSearchDialogFiller::Action> actions;
3977 actions << NcbiSearchDialogFiller::Action(NcbiSearchDialogFiller::SetTerm, searchField)
3978 << NcbiSearchDialogFiller::Action(NcbiSearchDialogFiller::ClickSearch, QVariant())
3979 << NcbiSearchDialogFiller::Action(NcbiSearchDialogFiller::WaitTasksFinish, QVariant())
3980 << NcbiSearchDialogFiller::Action(NcbiSearchDialogFiller::SelectResultsByNumbers, variantNumbers)
3981 << NcbiSearchDialogFiller::Action(NcbiSearchDialogFiller::ClickDownload, remoteDialogActionsVariant)
3982 << NcbiSearchDialogFiller::Action(NcbiSearchDialogFiller::ClickClose, QVariant());
3983 GTUtilsDialog::waitForDialog(os, new NcbiSearchDialogFiller(os, actions));
3984
3985 GTMenu::clickMainMenuItem(os, QStringList() << "File"
3986 << "Search NCBI GenBank...");
3987
3988 GTUtilsTaskTreeView::waitTaskFinished(os);
3989
3990 // 6. With Ctrl pressed, select all three annotation objects in the project view
3991 GTUtilsProjectTreeView::openView(os);
3992 GTKeyboardDriver::keyPress(Qt::Key_Control);
3993
3994 GTUtilsProjectTreeView::click(os, "AB797210 features");
3995 GTUtilsProjectTreeView::click(os, "AB797204 features");
3996 GTUtilsProjectTreeView::click(os, "AB797201 features");
3997
3998 GTKeyboardDriver::keyRelease(Qt::Key_Control);
3999
4000 // 7. delete this objects through context menu
4001 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "action_project__remove_selected_action"));
4002 GTMouseDriver::click(Qt::RightButton);
4003
4004 // Expected state : the objects are deleted, the popup is shown
4005 GTGlobals::FindOptions safeOptions(false);
4006 const QModelIndex firstIndex = GTUtilsProjectTreeView::findIndex(os, "AB797210 features", safeOptions);
4007 CHECK_SET_ERR(!firstIndex.isValid(), "The \"AB797210 features\" item has not been deleted");
4008 const QModelIndex secondIndex = GTUtilsProjectTreeView::findIndex(os, "AB797204 features", safeOptions);
4009 CHECK_SET_ERR(!secondIndex.isValid(), "The \"AB797204 features\" item has not been deleted");
4010 const QModelIndex thirdIndex = GTUtilsProjectTreeView::findIndex(os, "AB797201 features", safeOptions);
4011 CHECK_SET_ERR(!thirdIndex.isValid(), "The \"AB797201 features\" item has not been deleted");
4012
4013 GTUtilsLog::check(os, l);
4014 }
4015
GUI_TEST_CLASS_DEFINITION(test_2656)4016 GUI_TEST_CLASS_DEFINITION(test_2656) {
4017 // 0. Create a file with an empty sequence. A FASTA file with the first line ">seq1" and the empty second line
4018 // 1. Open any sequence
4019 // 2. On the toolbar, press "Build dotplot"
4020 // 3. Press "Load sequence" in the dialog. Load the empty sequence
4021 // 4. Select the empty sequence as the second sequence in the combobox
4022
4023 // Bug: UGENE crashes
4024 // Expected: an error message is shown
4025 GTLogTracer l;
4026
4027 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
4028 GTUtilsTaskTreeView::waitTaskFinished(os);
4029
4030 class DotplotLoadSequenceFiller : public Filler {
4031 public:
4032 DotplotLoadSequenceFiller(HI::GUITestOpStatus &os, const QString seqPath, const QString seqName)
4033 : Filler(os, "DotPlotDialog"), seqPath(seqPath), seqName(seqName) {
4034 }
4035 virtual void run() {
4036 QWidget *dialog = GTWidget::getActiveModalWidget(os);
4037 QPushButton *loadSeq = qobject_cast<QPushButton *>(GTWidget::findWidget(os, "loadSequenceButton", dialog));
4038 CHECK_SET_ERR(loadSeq != nullptr, "Load sequence button no found");
4039 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, seqPath, seqName));
4040 GTWidget::click(os, loadSeq);
4041
4042 QDialogButtonBox *box = qobject_cast<QDialogButtonBox *>(GTWidget::findWidget(os, "buttonBox", dialog));
4043 QPushButton *button = box->button(QDialogButtonBox::Cancel);
4044 CHECK_SET_ERR(button != nullptr, "Cancel button is NULL");
4045 GTWidget::click(os, button);
4046 }
4047
4048 private:
4049 QString seqPath;
4050 QString seqName;
4051 };
4052
4053 GTUtilsDialog::waitForDialog(os, new DotplotLoadSequenceFiller(os, testDir + "_common_data/fasta", "empty_2.fa"));
4054 GTWidget::click(os, GTWidget::findWidget(os, "build_dotplot_action_widget"));
4055 GTThread::waitForMainThread();
4056
4057 CHECK_SET_ERR(l.hasErrors(), "Expected to have errors in the log, but no errors found");
4058 }
4059
GUI_TEST_CLASS_DEFINITION(test_2662)4060 GUI_TEST_CLASS_DEFINITION(test_2662) {
4061 // 1. Open WD.
4062 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4063 // 2. Open Call Variants sample.
4064 GTUtilsWorkflowDesigner::addSample(os, "Call variants");
4065 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4066 // 3. Set valid input data.
4067 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Assembly (BAM/SAM)"));
4068 GTMouseDriver::click();
4069 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/bam/chrM.sorted.bam");
4070
4071 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
4072 GTMouseDriver::click();
4073 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cmdline/call-variations/chrM.fa");
4074 // 4. Start the scheme.
4075 GTUtilsWorkflowDesigner::runWorkflow(os);
4076 GTUtilsTaskTreeView::waitTaskFinished(os);
4077 // 5. Open External Tools tab.
4078 GTUtilsDashboard::openTab(os, GTUtilsDashboard::ExternalTools);
4079 // Expected state: vcfTools executible file is /usr/bin/perl path/to/vcfutils.pl
4080 // Actual: vcfTools executible file is /usr/bin/perl
4081
4082 auto node = GTUtilsDashboard::getExternalToolNodeByText(os, "vcfutils run");
4083 GTWidget::click(os, node);
4084
4085 #ifdef Q_OS_WIN
4086 GTUtilsDashboard::getExternalToolNodeByText(os, "samtools\\vcfutils.pl", false);
4087 #else
4088 GTUtilsDashboard::getExternalToolNodeByText(os, "samtools/vcfutils.pl", false);
4089 #endif
4090 }
4091
GUI_TEST_CLASS_DEFINITION(test_2667)4092 GUI_TEST_CLASS_DEFINITION(test_2667) {
4093 // 1. Open {/data/samples/genbank/murine.gb}.
4094 // Expected state: a document was added, it contains two object: an annotation and a sequence
4095 GTFileDialog::openFile(os, dataDir + "/samples/Genbank/", "murine.gb");
4096 GTUtilsTaskTreeView::waitTaskFinished(os);
4097
4098 // 2. Select the annotation object in the project view.
4099 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "NC_001363 features"));
4100 GTMouseDriver::click();
4101
4102 // 3. Press "delete" key.
4103 // Expected state: the annotation object is removed from the document.
4104 GTKeyboardDriver::keyClick(Qt::Key_Delete);
4105 GTGlobals::FindOptions options;
4106 options.failIfNotFound = false;
4107 GTUtilsProjectTreeView::findIndex(os, "NC_001363 features", options);
4108 }
4109
GUI_TEST_CLASS_DEFINITION(test_2683)4110 GUI_TEST_CLASS_DEFINITION(test_2683) {
4111 // 1. Open Tuxedo sample scheme in WD.
4112 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4113
4114 class custom : public CustomScenario {
4115 public:
4116 void run(HI::GUITestOpStatus &os) {
4117 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
4118
4119 QWidget *dialog = GTWidget::getActiveModalWidget(os);
4120 QString title = GTUtilsWizard::getPageTitle(os);
4121 CHECK_SET_ERR(title == "Cuffdiff Samples", "unexpected title: " + title);
4122
4123 GTWidget::findWidget(os, "Sample1", dialog);
4124 GTWidget::findWidget(os, "Sample2", dialog);
4125
4126 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
4127 }
4128 };
4129 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Tuxedo Workflow", QStringList() << "Full"
4130 << "Single-end"));
4131 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Tuxedo Wizard", new custom()));
4132 GTUtilsWorkflowDesigner::addSample(os, "RNA-seq analysis with Tuxedo tools");
4133 // Expected state: in appeared wizard there is a page "Cuffdiff Samples"
4134 // where user can divide input datasets into samples for Cuffdiff tool.
4135 }
4136
GUI_TEST_CLASS_DEFINITION(test_2690)4137 GUI_TEST_CLASS_DEFINITION(test_2690) {
4138 // 1. Open "human_t1.fa".
4139 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
4140 GTUtilsTaskTreeView::waitTaskFinished(os);
4141 // 2. Create an annotation: Group name - "1", location - "1..1".
4142 GTUtilsDialog::waitForDialog(os, new CreateAnnotationWidgetFiller(os, true, "1", "ann1", "1..1"));
4143 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
4144 << "Add"
4145 << "New annotation...");
4146
4147 // 3. Create an annotation: Group name - "2", location - "5..5, 6..7".
4148 GTUtilsDialog::waitForDialog(os, new CreateAnnotationWidgetFiller(os, true, "2", "ann2", "5..5, 6..7"));
4149 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
4150 << "Add"
4151 << "New annotation...");
4152
4153 // 4. Open the "Annotation highlighting" OP widget.
4154 GTWidget::click(os, GTWidget::findWidget(os, "OP_ANNOT_HIGHLIGHT"));
4155 // 5. Select the first annotation.
4156 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "ann1"));
4157 GTMouseDriver::click();
4158 // 6. Click the "next annotation" button.
4159 QWidget *nextAnnotationButton = GTWidget::findWidget(os, "nextAnnotationButton");
4160 GTWidget::click(os, nextAnnotationButton);
4161 // Expected state: the second annotation is selected.
4162 QString str = GTUtilsAnnotationsTreeView::getSelectedItem(os);
4163 CHECK_SET_ERR(str == "ann2", "unexpected selected annotation after click: " + str);
4164 CHECK_SET_ERR(!nextAnnotationButton->isEnabled(), "nextAnnotationButton is unexpectedly enabled");
4165 }
4166
GUI_TEST_CLASS_DEFINITION(test_2701)4167 GUI_TEST_CLASS_DEFINITION(test_2701) {
4168 // 1. Open {/data/samples/genbank/CVU55762.gb}.
4169 // Expected state: a document was added, circular view is opened
4170
4171 // 2. Click on Save circular view as image.
4172 // Expected state: Opened Export Image dialog
4173
4174 // 3. Select vector format (svg, pdf or ps)
4175 // Expected state: Quality tuning slider is not showed.
4176
4177 // 4. Select jpg format
4178 // Expected state: Quality tuning slider is showed.
4179 GTFileDialog::openFile(os, dataDir + "/samples/Genbank/", "CVU55762.gb");
4180 GTUtilsTaskTreeView::waitTaskFinished(os);
4181 ADVSingleSequenceWidget *wgt = GTUtilsSequenceView::getSeqWidgetByNumber(os);
4182 CHECK_SET_ERR(wgt != nullptr, "No sequence widget");
4183 CHECK_SET_ERR(GTUtilsCv::isCvPresent(os, wgt), "No CV opened");
4184
4185 class ImageQualityChecker : public Filler {
4186 public:
4187 ImageQualityChecker(HI::GUITestOpStatus &os)
4188 : Filler(os, "ImageExportForm") {
4189 }
4190 virtual void run() {
4191 QWidget *dialog = GTWidget::getActiveModalWidget(os);
4192 QComboBox *formatsBox = dialog->findChild<QComboBox *>("formatsBox");
4193 QWidget *spin = dialog->findChild<QSpinBox *>("qualitySpinBox");
4194
4195 GTComboBox::selectItemByText(os, formatsBox, "SVG");
4196 CHECK_SET_ERR(!spin->isVisible(), "Quality spin box is visible!");
4197 GTComboBox::selectItemByText(os, formatsBox, "PDF");
4198 CHECK_SET_ERR(!spin->isVisible(), "Quality spin box is visible!");
4199 GTComboBox::selectItemByText(os, formatsBox, "PS");
4200 CHECK_SET_ERR(!spin->isVisible(), "Quality spin box is visible!");
4201
4202 GTComboBox::selectItemByText(os, formatsBox, "JPG");
4203 CHECK_SET_ERR(spin->isVisible(), "Quality spin box not visible!");
4204
4205 QDialogButtonBox *box = qobject_cast<QDialogButtonBox *>(GTWidget::findWidget(os, "buttonBox", dialog));
4206 CHECK_SET_ERR(box != nullptr, "buttonBox is NULL");
4207 QPushButton *button = box->button(QDialogButtonBox::Cancel);
4208 CHECK_SET_ERR(button != nullptr, "Cancel button is NULL");
4209 GTWidget::click(os, button);
4210 }
4211 };
4212
4213 GTUtilsDialog::waitForDialog(os, new ImageQualityChecker(os));
4214 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_EXPORT << "Save circular view as image", GTGlobals::UseMouse));
4215
4216 QWidget *circularView = GTWidget::findWidget(os, "CV_ADV_single_sequence_widget_0");
4217 CHECK_OP_SET_ERR(os, "Failed to open circular view!");
4218 GTWidget::click(os, circularView, Qt::RightButton);
4219 }
4220
GUI_TEST_CLASS_DEFINITION(test_2709)4221 GUI_TEST_CLASS_DEFINITION(test_2709) {
4222 // 1. Open tuxedo sample "no-new-transcripts"
4223
4224 class test_2709_canceler : public CustomScenario {
4225 public:
4226 void run(HI::GUITestOpStatus &os) {
4227 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
4228 }
4229 };
4230 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4231 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Tuxedo Workflow", QStringList() << "No-new-transcripts"
4232 << "Single-end"));
4233 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Tuxedo Wizard", new test_2709_canceler()));
4234 GTUtilsWorkflowDesigner::addSample(os, "tuxedo");
4235 // Expected state: "No novel junctions" tophat parameter set to true by default
4236 GTUtilsWorkflowDesigner::click(os, "Map RNA-Seq Reads with TopHat");
4237 QString result = GTUtilsWorkflowDesigner::getParameter(os, "No novel junctions");
4238 CHECK_SET_ERR(result == "True", "No novel junctions parameter is " + result);
4239 }
4240
GUI_TEST_CLASS_DEFINITION(test_2713)4241 GUI_TEST_CLASS_DEFINITION(test_2713) {
4242 // 1. Open file {data/samples/Genbank/murine.gb}
4243 GTFile::copy(os, dataDir + "samples/Genbank/murine.gb", sandBoxDir + "test_2713.gb");
4244 GTFileDialog::openFile(os, sandBoxDir, "test_2713.gb");
4245 GTUtilsTaskTreeView::waitTaskFinished(os);
4246
4247 // 2. Open file {data/samples/FASTA/human_T1.fa}
4248 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
4249 GTUtilsTaskTreeView::waitTaskFinished(os);
4250
4251 // 3. Drag and drop annotation object "NC_001363 features" from project view to sequence view
4252 // Expected state: the "Edit Object Relations" dialog has appeared
4253 // 4. Press "OK"
4254 // Expected state: annotations has appeared on the sequence view
4255 GTUtilsDialog::waitForDialog(os, new CreateObjectRelationDialogFiller(os));
4256 GTWidget::click(os, GTUtilsProjectTreeView::getTreeView(os));
4257
4258 QPoint point = GTUtilsProjectTreeView::getItemCenter(os, "NC_001363 features");
4259 point.setX(point.x() + 1);
4260 point.setY(point.y() + 1);
4261 GTMouseDriver::moveTo(point);
4262 GTMouseDriver::click();
4263
4264 QPoint endPoint = GTWidget::getWidgetCenter(GTUtilsAnnotationsTreeView::getTreeWidget(os));
4265 GTMouseDriver::dragAndDrop(point, endPoint);
4266
4267 GTUtilsDialog::waitAllFinished(os);
4268
4269 // 5. Open file {data/samples/Genbank/murine.gb} with text editor, then make some modification and save file
4270 // Expected state: dialog about detected file modification has appeared in UGENE window
4271 // 6. Press "Yes"
4272 // Expected state: "human_T1" view has disappeared from the "Bookmarks" list, "murine.gb" has been reloaded.
4273 const GUIDialogWaiter::WaitSettings waitSettings("");
4274 GTUtilsDialog::waitForDialog(os,
4275 new MessageBoxDialogFiller(os,
4276 QMessageBox::Yes,
4277 "Document 'test_2713.gb' was modified. Do you want to reload it?",
4278 ""),
4279 waitSettings);
4280
4281 QFile file(sandBoxDir + "/test_2713.gb");
4282 bool opened = file.open(QIODevice::ReadOnly | QIODevice::Text);
4283 CHECK_SET_ERR(opened, "Can't open the file: " + sandBoxDir + "test_2713.gb");
4284 QByteArray fileData = file.readAll();
4285 file.close();
4286
4287 fileData.replace("gag polyprotein", "ggg_polyprotein");
4288
4289 GTGlobals::sleep(1000); // wait at least 1 second: UGENE does not detect file changes within 1 second interval.
4290 opened = file.open(QIODevice::WriteOnly);
4291 CHECK_SET_ERR(opened, "Can't open the file: " + sandBoxDir + "test_2713.gb");
4292 file.write(fileData);
4293 file.close();
4294
4295 GTUtilsDialog::waitAllFinished(os);
4296 // 7. Open "human_T1" sequence view
4297 // Expected state: annotations from "murine.gb" present on the sequence view
4298 GTUtilsProjectTreeView::doubleClickItem(os, "human_T1.fa");
4299 GTUtilsTaskTreeView::waitTaskFinished(os);
4300 GTUtilsAnnotationsTreeView::findFirstAnnotation(os);
4301 }
4302
GUI_TEST_CLASS_DEFINITION(test_2721)4303 GUI_TEST_CLASS_DEFINITION(test_2721) {
4304 // Note: Make sure first that "data" contains "cistrome" folder with proper data.
4305
4306 // 1. Open WD.
4307 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4308 // 2. Select Cistrome example.
4309 class custom : public CustomScenario {
4310 public:
4311 void run(HI::GUITestOpStatus &os) {
4312 // Expected state: wizard appeared - on the first page "Cistrome data folder" is set to "/cistrome".
4313 QWidget *dialog = GTWidget::getActiveModalWidget(os);
4314 QLineEdit *urlLineEdit = GTWidget::findExactWidget<QLineEdit *>(os, "urlLineEdit", dialog);
4315 QString url = urlLineEdit->text();
4316 CHECK_SET_ERR(url.contains("/cistrome"), "unexpected url: " + url);
4317
4318 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
4319 }
4320 };
4321 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Cistrome Workflow", new custom()));
4322 GTUtilsWorkflowDesigner::addSample(os, "Cistrome");
4323 }
4324
GUI_TEST_CLASS_DEFINITION(test_2726)4325 GUI_TEST_CLASS_DEFINITION(test_2726) {
4326 // 1. Open "COI.aln".
4327 // 2. Select the second symbol at the first line.
4328 // 3. Press backspace twice.
4329 // Expected state: undo and redo buttons are disabled.
4330 GTFileDialog::openFile(os, dataDir + "/samples/CLUSTALW/", "COI.aln");
4331 GTUtilsTaskTreeView::waitTaskFinished(os);
4332
4333 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(1, 0), QPoint(1, 0));
4334 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
4335 GTKeyboardDriver::keyClick(Qt::Key_Backspace);
4336
4337 // Expected state : MSA view has opened, the "Undo" button is disabled.
4338 QAbstractButton *undoButton = GTAction::button(os, "msa_action_undo");
4339 CHECK_SET_ERR(!undoButton->isEnabled(), "'Undo' button is unexpectedly enabled");
4340 // Expected state : MSA view has opened, the "Redo" button is disabled.
4341 QAbstractButton *redoButton = GTAction::button(os, "msa_action_undo");
4342 CHECK_SET_ERR(!redoButton->isEnabled(), "'Redo' button is unexpectedly enabled");
4343 }
4344
GUI_TEST_CLASS_DEFINITION(test_2729)4345 GUI_TEST_CLASS_DEFINITION(test_2729) {
4346 // 1. Open {_common_data/fasta/AMINO.fa}
4347 // Expected state: there is no a "Graphs" button on the sequence toolbar for amino, it is invisible and disabled.
4348 GTFileDialog::openFile(os, testDir + "_common_data/fasta/", "AMINO.fa");
4349 GTUtilsTaskTreeView::waitTaskFinished(os);
4350 QAbstractButton *graphsButton = GTAction::button(os, "GraphMenuAction", GTUtilsSequenceView::getSeqWidgetByNumber(os));
4351 CHECK_SET_ERR(nullptr != graphsButton, "Graphs button is NULL");
4352 CHECK_SET_ERR(!graphsButton->isEnabled(), "Graphs button is unexpectedly enabled");
4353
4354 // 2. Click the "Graphs" button.
4355 // Expected state: menu is shown.
4356 // GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList()));
4357 // GTWidget::click(os, graphsButton);
4358 }
4359
GUI_TEST_CLASS_DEFINITION(test_2730)4360 GUI_TEST_CLASS_DEFINITION(test_2730) {
4361 /* 1. Open "_common_data/fasta/abcd.fa" as separate sequences in the sequence viewer.
4362 2. Click the "Automatic Annotation Highlighting" button on the first sequence's toolbar.
4363 3. Click the "Plasmid features" button.
4364 Expected: UGENE does not crash.
4365 */
4366 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os));
4367 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/abcd.fa");
4368 GTUtilsTaskTreeView::waitTaskFinished(os);
4369 QWidget *parent = GTWidget::findWidget(os, "ADV_single_sequence_widget_0");
4370 CHECK_SET_ERR(parent != nullptr, "ADV_single_sequence_widget_0 not found!");
4371
4372 QWidget *menuAction = GTWidget::findWidget(os, "AutoAnnotationUpdateAction", parent);
4373 CHECK_SET_ERR(menuAction != nullptr, "AutoAnnotationUpdateAction not found!");
4374 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Plasmid features"));
4375 GTWidget::click(os, menuAction);
4376 // Close file - UGENE does not crash.
4377 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "abcd.fa"));
4378 GTMouseDriver::click();
4379 GTKeyboardDriver::keyClick(Qt::Key_Delete);
4380 }
4381
GUI_TEST_CLASS_DEFINITION(test_2737)4382 GUI_TEST_CLASS_DEFINITION(test_2737) {
4383 // 1. Open any sequence without annotations (e.g. "_common_data/fasta/AMINO.fa")
4384 GTFileDialog::openFile(os, testDir + "_common_data/fasta/", "AMINO.fa");
4385 GTUtilsTaskTreeView::waitTaskFinished(os);
4386
4387 // 2. Add few annotations with different names.
4388 GTUtilsAnnotationsTreeView::createAnnotation(os, "group", "name1", "1..10");
4389 GTUtilsAnnotationsTreeView::createAnnotation(os, "group", "name2", "11..20", false);
4390 GTUtilsAnnotationsTreeView::createAnnotation(os, "group", "name3", "21..30", false);
4391 GTUtilsTaskTreeView::waitTaskFinished(os);
4392
4393 // 3. Open Annotation Highlighting tab.
4394 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::AnnotationsHighlighting);
4395
4396 // 4. Delete all annotations one by one.
4397 GTUtilsAnnotationsTreeView::deleteItem(os, "name1");
4398 GTUtilsAnnotationsTreeView::deleteItem(os, "name2");
4399 GTUtilsAnnotationsTreeView::deleteItem(os, "name3");
4400
4401 // Expected state: there is no annotations is annotation tree.
4402 QWidget *annotationsTree = GTWidget::findWidget(os, "OP_ANNOT_HIGHLIGHT_TREE");
4403 CHECK_SET_ERR(!annotationsTree->isVisible(), "Annotations tree is shown");
4404 }
4405
GUI_TEST_CLASS_DEFINITION(test_2737_1)4406 GUI_TEST_CLASS_DEFINITION(test_2737_1) {
4407 GTLogTracer l;
4408 // 1. Open "murine.gb";
4409 GTFileDialog::openFile(os, dataDir + "samples/Genbank", "murine.gb");
4410 GTUtilsTaskTreeView::waitTaskFinished(os);
4411 // 1.1. Open Annotation Highlighting tab.
4412 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::AnnotationsHighlighting);
4413
4414 // 2. Delete all annotations in random order;
4415 QTreeWidgetItem *annotation = nullptr;
4416 while (nullptr != (annotation = GTUtilsAnnotationsTreeView::findFirstAnnotation(os, GTGlobals::FindOptions(false)))) {
4417 uiLog.trace("annotation text is: " + annotation->text(0));
4418 GTUtilsAnnotationsTreeView::deleteItem(os, annotation);
4419 }
4420
4421 // Expected state: no errors in the log
4422 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
4423 }
4424
GUI_TEST_CLASS_DEFINITION(test_2754)4425 GUI_TEST_CLASS_DEFINITION(test_2754) {
4426 // 1. Open "murine.gb";
4427 GTFileDialog::openFile(os, dataDir + "samples/Genbank", "murine.gb");
4428 GTUtilsTaskTreeView::waitTaskFinished(os);
4429
4430 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "NC_001363 features"));
4431 GTMouseDriver::doubleClick();
4432
4433 class custom : public CustomScenario {
4434 public:
4435 void run(HI::GUITestOpStatus &os) {
4436 QWidget *dialog = GTWidget::getActiveModalWidget(os);
4437 QAbstractButton *next = GTWidget::findButtonByText(os, "Next", dialog);
4438 CHECK_SET_ERR(!next->isEnabled(), "Next button is unexpectidly enabled");
4439
4440 QAbstractButton *selectAll = GTWidget::findButtonByText(os, "Select all", dialog);
4441 CHECK_SET_ERR(!selectAll->isEnabled(), "Select all button is unexpectidly enabled");
4442
4443 GTWidget::click(os, GTWidget::findButtonByText(os, "Close", dialog));
4444 }
4445 };
4446
4447 GTUtilsDialog::waitForDialog(os, new FindQualifierFiller(os, new custom()));
4448
4449 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "find_qualifier_action"));
4450 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "CDS"));
4451 GTMouseDriver::click(Qt::RightButton);
4452 }
4453
GUI_TEST_CLASS_DEFINITION(test_2761_1)4454 GUI_TEST_CLASS_DEFINITION(test_2761_1) {
4455 // 1. Open "samples/CLUSTALW/COI.aln".
4456 QDir().mkpath(sandBoxDir + "test_2761_1");
4457 GTFile::setReadOnly(os, sandBoxDir + "test_2761_1");
4458 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/COI.aln");
4459 GTUtilsTaskTreeView::waitTaskFinished(os);
4460 // 2. Select some area in the MSA.
4461 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(2, 2), QPoint(5, 5));
4462 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EXPORT << "Save subalignment"));
4463 // 3. Context menu of the area -> Export -> Save subalignment.
4464
4465 class customFiller : public ExtractSelectedAsMSADialogFiller {
4466 public:
4467 customFiller(HI::GUITestOpStatus &os)
4468 : ExtractSelectedAsMSADialogFiller(os, testDir + "_common_data/scenarios/sandbox/test_2761_1/2761.aln", QStringList() << "Bicolorana_bicolor_EF540830"
4469 << "Roeseliana_roeseli") {
4470 }
4471 void run() override {
4472 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "No write permission"));
4473 ExtractSelectedAsMSADialogFiller::run();
4474 GTUtilsDialog::clickButtonBox(os, QDialogButtonBox::Cancel);
4475 }
4476 };
4477
4478 GTUtilsDialog::waitForDialog(os, new customFiller(os));
4479 GTMouseDriver::click(Qt::RightButton);
4480 // 4. Set the destination path to the dir without write permissions.
4481 // 5. Click "Extract".
4482 // Expected: the message about write permissions to the dir appears. The extraction task is not run.
4483 }
4484
GUI_TEST_CLASS_DEFINITION(test_2761_2)4485 GUI_TEST_CLASS_DEFINITION(test_2761_2) {
4486 // 1. Open "samples/CLUSTALW/COI.aln".
4487 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/COI.aln");
4488 GTUtilsTaskTreeView::waitTaskFinished(os);
4489 // 2. Select some area in the MSA.
4490 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(2, 2), QPoint(5, 5));
4491 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EXPORT << "Save subalignment"));
4492 // 3. Context menu of the area -> Export -> Save subalignment.
4493
4494 class customFiller : public ExtractSelectedAsMSADialogFiller {
4495 public:
4496 customFiller(HI::GUITestOpStatus &os)
4497 : ExtractSelectedAsMSADialogFiller(os, testDir + "_common_data/scenarios/sandbox/test_2761_2/2761.aln", QStringList() << "Bicolorana_bicolor_EF540830"
4498 << "Roeseliana_roeseli") {
4499 }
4500 void run() override {
4501 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "Export folder does not exist"));
4502 ExtractSelectedAsMSADialogFiller::run();
4503 GTUtilsDialog::clickButtonBox(os, QDialogButtonBox::Cancel);
4504 }
4505 };
4506
4507 GTUtilsDialog::waitForDialog(os, new customFiller(os));
4508 GTMouseDriver::click(Qt::RightButton);
4509 // 4. Set the destination path to the dir that does not exists
4510 // 5. Click "Extract".
4511 // Expected: the message about write permissions to the dir appears. The extraction task is not run.
4512 }
4513
GUI_TEST_CLASS_DEFINITION(test_2762)4514 GUI_TEST_CLASS_DEFINITION(test_2762) {
4515 /* 1. Open something, e.g. "human_T1.fa".
4516 2. Close the project.
4517 Expected state: a dialog will appear that offer you to save the project.
4518 3. Press escape key.
4519 Expected state: the dialog will closed as canceled.
4520 */
4521 class EscClicker : public Filler {
4522 public:
4523 EscClicker(HI::GUITestOpStatus &_os)
4524 : Filler(_os, "SaveProjectDialog") {
4525 }
4526 virtual void run() {
4527 #ifdef Q_OS_DARWIN
4528 QDialogButtonBox *buttonBox = qobject_cast<QDialogButtonBox *>(GTWidget::findWidget(os, "buttonBox"));
4529 QAbstractButton *cancel = buttonBox->button(QDialogButtonBox::Cancel);
4530 GTWidget::click(os, cancel);
4531 #else
4532 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4533 #endif
4534 }
4535 };
4536
4537 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
4538 GTUtilsTaskTreeView::waitTaskFinished(os);
4539 GTUtilsDialog::waitForDialog(os, new EscClicker(os));
4540 GTMenu::clickMainMenuItem(os, QStringList() << "File"
4541 << "Close project");
4542
4543 GTUtilsProject::checkProject(os);
4544 }
4545
GUI_TEST_CLASS_DEFINITION(test_2770)4546 GUI_TEST_CLASS_DEFINITION(test_2770) {
4547 // 1. File -> New document from text.
4548 // 2. Data: TTTTTTTTTTTTTTTTTTTTTTTAAATTTTTTTTTTTTTTTTTTTTTTT
4549 // Location: set the valid output file.
4550 // 3. Create.
4551 // 4. Ctrl + F.
4552 // 5. Pattern: TTTTTTTTTTTTTTTTTTTTTTTAATTTTTTTTTTTTTTTTTTTTTTT
4553 // Algorithm: InsDel
4554 // Should match: 30%
4555 // 6. Search.
4556 // Expected: two annotations are found.
4557 Runnable *filler = new CreateDocumentFiller(os,
4558 "TTTTTTTTTTTTTTTTTTTTTTTAAATTTTTTTTTTTTTTTTTTTTTTT",
4559 false,
4560 CreateDocumentFiller::StandardRNA,
4561 true,
4562 false,
4563 "",
4564 testDir + "_common_data/scenarios/sandbox/result",
4565 CreateDocumentFiller::FASTA,
4566 "result",
4567 true);
4568 GTUtilsDialog::waitForDialog(os, filler);
4569
4570 GTMenu::clickMainMenuItem(os, QStringList() << "File"
4571 << "New document from text...",
4572 GTGlobals::UseKey);
4573 GTUtilsTaskTreeView::waitTaskFinished(os);
4574
4575 GTUtilsDocument::checkDocument(os, "result");
4576
4577 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::Search);
4578
4579 GTUtilsOptionPanelSequenceView::enterPattern(os, "TTTTTTTTTTTTTTTTTTTTTTTAATTTTTTTTTTTTTTTTTTTTTTT", true);
4580
4581 GTUtilsOptionPanelSequenceView::setAlgorithm(os, "InsDel");
4582
4583 GTUtilsOptionPanelSequenceView::setMatchPercentage(os, 30);
4584
4585 GTUtilsOptionPanelSequenceView::clickGetAnnotation(os);
4586 GTUtilsTaskTreeView::waitTaskFinished(os);
4587
4588 QTreeWidgetItem *annotationGroup = GTUtilsAnnotationsTreeView::findItem(os, "Misc. Feature (0, 2)");
4589 CHECK_SET_ERR(nullptr != annotationGroup, "Annotations have not been found");
4590 }
4591
GUI_TEST_CLASS_DEFINITION(test_2773)4592 GUI_TEST_CLASS_DEFINITION(test_2773) {
4593 // 1. Open file test/_common_data/cmdline/custom-script-worker-functions/translateTest/translateTest.uwl
4594 // 2. Set parameters:
4595 // input: _common_data/cmdline/DNA.fa
4596 // offset: sss
4597 // out: some/valid/path
4598 // 3. run the scheme.
4599 // Expected state: UGENE doesn't crash, error message appears.
4600
4601 GTFile::copy(os, testDir + "_common_data/cmdline/_proto/translateTest.usa", dataDir + "/workflow_samples/users/translateTest.usa");
4602
4603 GTLogTracer l;
4604 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4605
4606 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new StartupDialogFiller(os));
4607 GTUtilsWorkflowDesigner::loadWorkflow(os, testDir + "_common_data/cmdline/custom-script-worker-functions/translateTest/translateTest.uwl");
4608 GTUtilsTaskTreeView::waitTaskFinished(os);
4609
4610 GTUtilsWorkflowDesigner::click(os, "Read Sequence");
4611 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/cmdline/DNA.fa");
4612
4613 GTUtilsWorkflowDesigner::click(os, "translateTest");
4614 GTUtilsWorkflowDesigner::setParameter(os, "offset", "sss", GTUtilsWorkflowDesigner::textValue);
4615
4616 GTUtilsWorkflowDesigner::click(os, "Write sequence");
4617 GTUtilsWorkflowDesigner::setParameter(os, "Output file", "_common_data/cmdline/result_test_offset", GTUtilsWorkflowDesigner::textValue);
4618
4619 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
4620 GTWidget::click(os, GTAction::button(os, "Run workflow"));
4621
4622 GTUtilsLog::check(os, l);
4623 }
GUI_TEST_CLASS_DEFINITION(test_2778)4624 GUI_TEST_CLASS_DEFINITION(test_2778) {
4625 // 1. Use main menu : tools->align to reference->align short reads
4626 // 2. Set input parameters
4627 // input sequence : _common_data / genome_aligner / chrY.fa
4628 // short reads : _common_data / genome_aligner / shortreads15Mb.fasta
4629 // mismatches allowed : checked
4630 // 3. Press start
4631
4632 // Expected state : the task should be finished without errors.
4633
4634 GTLogTracer l;
4635
4636 AlignShortReadsFiller::UgeneGenomeAlignerParams parameters(testDir + "_common_data/genome_aligner/",
4637 "chrY.fa",
4638 testDir + "_common_data/genome_aligner/",
4639 "shortreads1Mb.fasta",
4640 true);
4641 parameters.samOutput = false;
4642 GTUtilsDialog::waitForDialog(os, new AlignShortReadsFiller(os, ¶meters));
4643
4644 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
4645 << "NGS data analysis"
4646 << "Map reads to reference...");
4647 GTUtilsTaskTreeView::waitTaskFinished(os);
4648 GTUtilsAssemblyBrowser::checkAssemblyBrowserWindowIsActive(os);
4649 GTUtilsTaskTreeView::waitTaskFinished(os);
4650
4651 GTUtilsLog::check(os, l);
4652 }
4653
GUI_TEST_CLASS_DEFINITION(test_2784)4654 GUI_TEST_CLASS_DEFINITION(test_2784) {
4655 GTLogTracer lt;
4656
4657 // 1. Open the file "data/samples/CLUSTALW/COI.aln"
4658 GTFileDialog::openFile(os, dataDir + "/samples/CLUSTALW/", "COI.aln");
4659 GTUtilsTaskTreeView::waitTaskFinished(os);
4660
4661 // Expected state : MSA view has opened, the "Undo" button is disabled.
4662 QAbstractButton *undoButton = GTAction::button(os, "msa_action_undo");
4663 CHECK_SET_ERR(!undoButton->isEnabled(), "'Undo' button is unexpectedly enabled");
4664
4665 // 2. Choose in the context menu{ Align->Align with MUSCLE… }
4666 // Expected state : The "Align with MUSCLE" dialog has appeared
4667 // 3. Check the "Translation to amino when aligning" checkbox and press "Align"
4668 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(41, 0), QPoint(43, 17));
4669 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
4670 const QString initialRegionContent = GTClipboard::text(os);
4671
4672 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4673
4674 GTUtilsDialog::waitForDialog(os, new MuscleDialogFiller(os, MuscleDialogFiller::Default, true, true));
4675 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with muscle", GTGlobals::UseMouse));
4676
4677 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(10, 5));
4678 GTMouseDriver::click(Qt::RightButton);
4679
4680 // Expected state : Alignment task has started.After some time it finishes without errors
4681 // and alignment gets changed somehow.The "Undo" button becomes active
4682 GTUtilsTaskTreeView::waitTaskFinished(os);
4683 GTUtilsLog::check(os, lt);
4684 CHECK_SET_ERR(undoButton->isEnabled(), "'Undo' button is unexpectedly disabled");
4685
4686 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(41, 0), QPoint(43, 17));
4687 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
4688 const QString alignedRegionContent = GTClipboard::text(os);
4689 CHECK_SET_ERR(alignedRegionContent != initialRegionContent, "Alignment content has not been changed");
4690 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4691
4692 // 4. Click on the "Undo" button
4693 GTWidget::click(os, undoButton);
4694
4695 // Expected state : Alignment has been restored to its initial state.The "Undo" button gets disabled,
4696 // the "Redo" has been enabled
4697 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(41, 0), QPoint(43, 17));
4698 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
4699 const QString undoneRegionContent = GTClipboard::text(os);
4700 CHECK_SET_ERR(undoneRegionContent == initialRegionContent, "Undo hasn't reverted changes");
4701 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4702
4703 CHECK_SET_ERR(!undoButton->isEnabled(), "'Undo' button is unexpectedly enabled");
4704
4705 QAbstractButton *redoButton = GTAction::button(os, "msa_action_redo");
4706 CHECK_SET_ERR(redoButton->isEnabled(), "'Redo' button is unexpectedly disabled");
4707
4708 // 5. Click on the "Redo" button
4709 GTWidget::click(os, redoButton);
4710
4711 // Expected state : Alignment has been changed.The "Redo" button gets disabled,
4712 // the "Undo" has been enabled
4713 GTUtilsMSAEditorSequenceArea::selectArea(os, QPoint(41, 0), QPoint(43, 17));
4714 GTKeyboardDriver::keyClick('c', Qt::ControlModifier);
4715 const QString redoneRegionContent = GTClipboard::text(os);
4716 CHECK_SET_ERR(redoneRegionContent == alignedRegionContent, "Redo hasn't changed the alignment");
4717 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4718
4719 CHECK_SET_ERR(!redoButton->isEnabled(), "'Redo' button is unexpectedly enabled");
4720 CHECK_SET_ERR(undoButton->isEnabled(), "'Undo' button is unexpectedly disabled");
4721 }
4722
GUI_TEST_CLASS_DEFINITION(test_2796)4723 GUI_TEST_CLASS_DEFINITION(test_2796) {
4724 // 1. Open file "_common_data/fasta/fa2.fa"
4725 GTFileDialog::openFile(os, testDir + "_common_data/fasta", "fa2.fa");
4726 GTUtilsTaskTreeView::waitTaskFinished(os);
4727
4728 // 2. Use main menu { Actions -> Analyse -> Find pattern[Smith-Waterman]... }
4729 // Expected state: the "Smith-Waterman Search" dialog has appeared
4730 // 3. Press "Cancel" in the dialog
4731 // Expected state: dialog has closed
4732 SmithWatermanDialogFiller *filler = new SmithWatermanDialogFiller(os);
4733 filler->button = SmithWatermanDialogFiller::Cancel;
4734 GTUtilsDialog::waitForDialog(os, filler);
4735 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
4736 << "Analyze"
4737 << "Find pattern [Smith-Waterman]...",
4738 GTGlobals::UseMouse);
4739 }
4740
GUI_TEST_CLASS_DEFINITION(test_2801)4741 GUI_TEST_CLASS_DEFINITION(test_2801) {
4742 // 1. Open {_common_data/clustal/100_sequences.aln}.
4743 GTFileDialog::openFile(os, testDir + "_common_data/clustal/", "3000_sequences.aln");
4744 GTUtilsTaskTreeView::waitTaskFinished(os);
4745
4746 // 2. Start MAFFT with default values.
4747 GTUtilsDialog::waitForDialog(os, new MAFFTSupportRunDialogFiller(os, new MAFFTSupportRunDialogFiller::Parameters()));
4748 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with MAFFT"));
4749 GTWidget::click(os, GTUtilsMdi::activeWindow(os), Qt::RightButton);
4750
4751 // 3. Cancel the align task.
4752 GTUtilsTaskTreeView::openView(os);
4753 GTUtilsTaskTreeView::checkTask(os, "Run MAFFT alignment task");
4754 GTUtilsTaskTreeView::cancelTask(os, "Run MAFFT alignment task");
4755 // Expected state: the task is cancelled, there is no MAFFT processes with its subprocesses (check for the "disttbfast" process)
4756 GTUtilsTaskTreeView::waitTaskFinished(os);
4757 }
4758
GUI_TEST_CLASS_DEFINITION(test_2801_1)4759 GUI_TEST_CLASS_DEFINITION(test_2801_1) {
4760 // 1. Open {_common_data/clustal/100_sequences.aln}.
4761 GTFileDialog::openFile(os, testDir + "_common_data/clustal/", "3000_sequences.aln");
4762 GTUtilsTaskTreeView::waitTaskFinished(os);
4763
4764 // 2. Start MAFFT with default values.
4765 GTUtilsDialog::waitForDialog(os, new MAFFTSupportRunDialogFiller(os, new MAFFTSupportRunDialogFiller::Parameters()));
4766 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with MAFFT", GTGlobals::UseMouse));
4767 GTWidget::click(os, GTUtilsMdi::activeWindow(os), Qt::RightButton);
4768 GTGlobals::sleep(20000);
4769
4770 // 3. Cancel the align task.
4771 GTUtilsTaskTreeView::openView(os);
4772 GTUtilsTaskTreeView::checkTask(os, "Run MAFFT alignment task");
4773 GTUtilsTaskTreeView::cancelTask(os, "Run MAFFT alignment task");
4774 // Expected state: the task is cancelled, there is no MAFFT processes with its subprocesses (check for the "disttbfast" process)
4775 GTUtilsTaskTreeView::waitTaskFinished(os);
4776 }
4777
GUI_TEST_CLASS_DEFINITION(test_2808)4778 GUI_TEST_CLASS_DEFINITION(test_2808) {
4779 // 1. Open WD.
4780 // 2. Add "Sequence Marker" element to the scene, select it.
4781 // Expected state: there are buttons on the parameters widget: "add", "edit" and "remove". The "add" button is enabled, other buttons are disabled.
4782 // 3. Add a new marker group (click the "add" button and fill the dialog).
4783 // Expected state: a new group was added, there is no selection in the marker group list, the "add" button is enabled, other buttons are disabled.
4784 // 4. Select the added group.
4785 // Expected state: the group is selected, all buttons are enabled.
4786 // 5. Click the "remove" button.
4787 // Expected state: the group is removed (the list is empty), the "add" button is enabled, other buttons are disabled.
4788
4789 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4790
4791 GTUtilsWorkflowDesigner::addAlgorithm(os, "Sequence Marker");
4792 GTUtilsWorkflowDesigner::click(os, "Sequence Marker");
4793
4794 QToolButton *addButton = qobject_cast<QToolButton *>(GTWidget::findWidget(os, "addButton"));
4795 CHECK_SET_ERR(addButton != nullptr, "AddButton not found!");
4796
4797 QToolButton *editButton = qobject_cast<QToolButton *>(GTWidget::findWidget(os, "editButton"));
4798 CHECK_SET_ERR(editButton != nullptr, "EditButton not found!");
4799
4800 QToolButton *removeButton = qobject_cast<QToolButton *>(GTWidget::findWidget(os, "removeButton"));
4801 CHECK_SET_ERR(removeButton != nullptr, "RemoveButton not found!");
4802
4803 CHECK_SET_ERR(addButton->isEnabled(), "AddButton is disabled!");
4804 CHECK_SET_ERR(!editButton->isEnabled(), "EditButton is enabled!");
4805 CHECK_SET_ERR(!removeButton->isEnabled(), "AddButton is enabled!");
4806
4807 class OkClicker : public Filler {
4808 public:
4809 OkClicker(HI::GUITestOpStatus &_os)
4810 : Filler(_os, "EditMarkerGroupDialog") {
4811 }
4812 virtual void run() {
4813 QWidget *w = QApplication::activeWindow();
4814 CHECK(nullptr != w, );
4815 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
4816 CHECK(nullptr != buttonBox, );
4817 QPushButton *button = buttonBox->button(QDialogButtonBox::Ok);
4818 CHECK(nullptr != button, );
4819 GTWidget::click(os, button);
4820 }
4821 };
4822 GTUtilsDialog::waitForDialog(os, new OkClicker(os));
4823 GTWidget::click(os, addButton);
4824
4825 CHECK_SET_ERR(addButton->isEnabled(), "AddButton is disabled!");
4826 CHECK_SET_ERR(!editButton->isEnabled(), "EditButton is enabled!");
4827 CHECK_SET_ERR(!removeButton->isEnabled(), "AddButton is enabled!");
4828
4829 QTableView *groupTable = qobject_cast<QTableView *>(GTWidget::findWidget(os, "markerTable"));
4830 CHECK_SET_ERR(groupTable != nullptr, "MerkerTable not found");
4831 GTWidget::click(os, groupTable);
4832
4833 QPoint p = GTTableView::getCellPosition(os, groupTable, 0, 0);
4834 GTMouseDriver::moveTo(p);
4835 GTMouseDriver::click();
4836
4837 CHECK_SET_ERR(addButton->isEnabled(), "AddButton is disabled!");
4838 CHECK_SET_ERR(editButton->isEnabled(), "EditButton is disabled!");
4839 CHECK_SET_ERR(removeButton->isEnabled(), "AddButton is disabled!");
4840
4841 GTWidget::click(os, removeButton);
4842
4843 CHECK_SET_ERR(groupTable->model() != nullptr, "Abstract table model is NULL");
4844 CHECK_SET_ERR(groupTable->model()->rowCount() == 0, "Marker table is not empty!");
4845 }
4846
GUI_TEST_CLASS_DEFINITION(test_2809)4847 GUI_TEST_CLASS_DEFINITION(test_2809) {
4848 // 1. Open WD.
4849 // 2. Add a "Sequence Marker" element to the scene, select it.
4850 // 3. Add several items to marker group list on the parameters widget.
4851 // Expected state: if all items are visible, there is no vertical scroll bar.
4852 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4853
4854 GTUtilsWorkflowDesigner::addAlgorithm(os, "Sequence Marker");
4855 GTUtilsWorkflowDesigner::click(os, "Sequence Marker");
4856
4857 QToolButton *addButton = qobject_cast<QToolButton *>(GTWidget::findWidget(os, "addButton"));
4858 CHECK_SET_ERR(addButton != nullptr, "AddButton not found!");
4859
4860 class OkClicker : public Filler {
4861 public:
4862 OkClicker(HI::GUITestOpStatus &_os)
4863 : Filler(_os, "EditMarkerGroupDialog") {
4864 }
4865 virtual void run() {
4866 QWidget *w = QApplication::activeWindow();
4867 CHECK(nullptr != w, );
4868 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
4869 CHECK(nullptr != buttonBox, );
4870 QPushButton *button = buttonBox->button(QDialogButtonBox::Ok);
4871 CHECK(nullptr != button, );
4872 GTWidget::click(os, button);
4873 }
4874 };
4875 GTUtilsDialog::waitForDialog(os, new OkClicker(os));
4876 GTWidget::click(os, addButton);
4877
4878 QTableView *groupTable = qobject_cast<QTableView *>(GTWidget::findWidget(os, "markerTable"));
4879 CHECK_SET_ERR(groupTable != nullptr, "MerkerTable not found");
4880 GTWidget::click(os, groupTable);
4881
4882 QScrollBar *scroll = groupTable->verticalScrollBar();
4883 CHECK_SET_ERR(scroll != nullptr, "Scroll bar is NULL");
4884 CHECK_SET_ERR(!scroll->isVisible(), "Scroll bar is visible!");
4885 }
4886
GUI_TEST_CLASS_DEFINITION(test_2811)4887 GUI_TEST_CLASS_DEFINITION(test_2811) {
4888 // 1. Open WD.
4889 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4890 GTUtilsWorkflowDesigner::toggleDebugMode(os);
4891 GTUtilsWorkflowDesigner::toggleBreakpointManager(os);
4892
4893 // 2. Open any workflow, create a breakpoint for any element.
4894 GTUtilsWorkflowDesigner::addSample(os, "Align sequences with MUSCLE");
4895 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4896 GTUtilsWorkflowDesigner::setBreakpoint(os, "Align with MUSCLE");
4897
4898 // 3. Open another workflow.
4899 // Expected state: breakpoints list is cleared.
4900 GTUtilsWorkflowDesigner::addSample(os, "Align sequences with MUSCLE");
4901 GTKeyboardDriver::keyClick(Qt::Key_Escape);
4902 QStringList breakpointList = GTUtilsWorkflowDesigner::getBreakpointList(os);
4903 CHECK_SET_ERR(breakpointList.isEmpty(), "There are unexpected breakpoints");
4904 }
4905
GUI_TEST_CLASS_DEFINITION(test_2829)4906 GUI_TEST_CLASS_DEFINITION(test_2829) {
4907 // 1) Open files "data/samples/Genbank/murine.gb" and "data/samples/Genbank/sars.gb" in separated views
4908 GTFileDialog::openFile(os, dataDir + "samples/Genbank", "murine.gb");
4909 GTUtilsTaskTreeView::waitTaskFinished(os);
4910 GTFileDialog::openFile(os, dataDir + "samples/Genbank", "sars.gb");
4911 GTUtilsTaskTreeView::waitTaskFinished(os);
4912
4913 // 2) Click on toolbar 'Build dotplot' button
4914 // 3) In opened dialog click 'OK' button
4915 GTUtilsDialog::waitForDialog(os, new DotPlotFiller(os));
4916 GTWidget::click(os, GTWidget::findWidget(os, "build_dotplot_action_widget"));
4917
4918 // 4) Choose some annotation by left mouse button on the upper sequence view
4919 // Expected state: horisontal or vertical selection is shown on DotPlot
4920 QList<QTreeWidgetItem *> geneItems = GTUtilsAnnotationsTreeView::findItems(os, "gene", GTGlobals::FindOptions(false));
4921 GTMouseDriver::moveTo(GTTreeWidget::getItemCenter(os, geneItems.at(1)));
4922 GTMouseDriver::click();
4923
4924 // 5) In second sequence view click Remove sequence on the toolbar
4925 // Expected state: DotPlot closed and UGENE didn't crash
4926 GTUtilsMdi::activateWindow(os, "NC_001363 [murine.gb]");
4927
4928 QWidget *toolbar = GTWidget::findWidget(os, "views_tool_bar_NC_001363", GTUtilsMdi::activeWindow(os));
4929 CHECK_SET_ERR(toolbar != nullptr, "Cannot find views_tool_bar_NC_001363");
4930 GTWidget::click(os, GTWidget::findWidget(os, "remove_sequence", toolbar));
4931 }
4932
GUI_TEST_CLASS_DEFINITION(test_2853)4933 GUI_TEST_CLASS_DEFINITION(test_2853) {
4934 GTUtilsDialog::waitForDialog(os, new NCBISearchDialogSimpleFiller(os, "rat"));
4935
4936 GTMenu::clickMainMenuItem(os, QStringList() << "File"
4937 << "Search NCBI GenBank...",
4938 GTGlobals::UseKey);
4939 GTUtilsTaskTreeView::waitTaskFinished(os);
4940 }
4941
GUI_TEST_CLASS_DEFINITION(test_2863)4942 GUI_TEST_CLASS_DEFINITION(test_2863) {
4943 // 1. Open WD.
4944 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4945 // 2. Add "Read File URL(s)".
4946 WorkflowProcessItem *fileList = GTUtilsWorkflowDesigner::addElement(os, "Read File URL(s)");
4947 // 3. Add "File Format Conversion".
4948 WorkflowProcessItem *conversion = GTUtilsWorkflowDesigner::addElement(os, "File Format Conversion");
4949 // 4. Connect the elements.
4950 GTUtilsWorkflowDesigner::connect(os, fileList, conversion);
4951 // Expected: the converter's input slot "Source URL" is binded with the "Source URL" slot of the Read File URL(s).
4952 GTUtilsWorkflowDesigner::click(os, conversion);
4953 QTableWidget *table = GTUtilsWorkflowDesigner::getInputPortsTable(os, 0);
4954 QString s1 = table->item(0, 0)->text();
4955 QString s2 = table->item(0, 1)->text();
4956 CHECK_SET_ERR(s1 == "Source URL", "unexpected first value: " + s1);
4957 CHECK_SET_ERR(s2 == "Source URL (by Read File URL(s))", "unexpected second value: " + s2)
4958 }
4959
GUI_TEST_CLASS_DEFINITION(test_2866)4960 GUI_TEST_CLASS_DEFINITION(test_2866) {
4961 // 1. Use main menu { Tools -> Align to reference -> Align short reads }
4962 // Expected state: the "Align Sequencing Reads" dialog has appeared
4963 // 2. Fill dialog: mapping tool: Bowtie
4964 // reference sequence: _common_data/e_coli/NC_008253.gff
4965 // short reads: "_common_data/e_coli/e_coli_1000.fastq"
4966 // Click start button
4967 // Expected state: message box with "These files have the incompatible format" has appeared
4968 // 3. Click "Yes"
4969 // Expected state: UGENE assembles reads without errors and the "Import SAM File" dialog has appeared
4970 GTLogTracer l;
4971
4972 AlignShortReadsFiller::Parameters parameters(testDir + "_common_data/e_coli/",
4973 "NC_008253.gff",
4974 testDir + "_common_data/e_coli/",
4975 "e_coli_1000.fastq",
4976 AlignShortReadsFiller::Parameters::Bowtie);
4977
4978 GTUtilsDialog::waitForDialog(os, new AlignShortReadsFiller(os, ¶meters));
4979 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "Yes"));
4980 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "test_2866.ugenedb"));
4981
4982 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
4983 << "NGS data analysis"
4984 << "Map reads to reference...");
4985 GTUtilsTaskTreeView::waitTaskFinished(os);
4986
4987 GTUtilsLog::check(os, l);
4988 }
4989
GUI_TEST_CLASS_DEFINITION(test_2884)4990 GUI_TEST_CLASS_DEFINITION(test_2884) {
4991 // 1. Open WD.
4992 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
4993 // 2. Place Cuffdiff element on the scene
4994 GTUtilsWorkflowDesigner::addAlgorithm(os, "Test for Diff. Expression with Cuffdiff");
4995 CHECK_OP(os, );
4996
4997 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Test for Diff. Expression with Cuffdiff"));
4998 GTMouseDriver::click();
4999 CHECK_SET_ERR(GTUtilsWorkflowDesigner::getParameter(os, "Multi read correct") == "False", "'Mate inner distance', Parameter value doesn't amtch");
5000 }
5001
GUI_TEST_CLASS_DEFINITION(test_2887)5002 GUI_TEST_CLASS_DEFINITION(test_2887) {
5003 // 1. Open WD.
5004 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
5005 // 2. Place Tophat element on the scene
5006 GTUtilsWorkflowDesigner::addAlgorithm(os, "Map RNA-Seq Reads with TopHat");
5007 CHECK_OP(os, );
5008 // 3. check "Mate inner distance" parameter is 50
5009 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Map RNA-Seq Reads with TopHat"));
5010 GTMouseDriver::click();
5011 CHECK_SET_ERR(GTUtilsWorkflowDesigner::getParameter(os, "Mate inner distance") == "50", "'Mate inner distance', Parameter value doesn't amtch");
5012 }
5013
GUI_TEST_CLASS_DEFINITION(test_2891)5014 GUI_TEST_CLASS_DEFINITION(test_2891) {
5015 // 1. Open file "data/samples/workflow_samples/NGS/cistrome/chip_seq.uwl"
5016 // 2. Set input file for the "Read Tags" element to "test/_common_data/bed/valid_input/tophat_output.bed"
5017 // 3. Press the "Validate workflow" button on the main toolbar
5018 // Expected state: the message box about workflow errors has appeared. The "Error list" tab has appeared below the workflow
5019 // 4. Press "OK"
5020 // Expected state: there is no messages about the "Read tags" element on the "Error list" tab
5021 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new StartupDialogFiller(os));
5022 GTFileDialog::openFile(os, dataDir + "/workflow_samples/NGS/cistrome/", "chip_seq.uwl");
5023 GTUtilsTaskTreeView::waitTaskFinished(os);
5024
5025 GTUtilsWorkflowDesigner::click(os, "Read Tags");
5026 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/bed/valid_input/tophat_output.bed");
5027
5028 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
5029 GTWidget::click(os, GTAction::button(os, "Validate workflow"));
5030 CHECK_SET_ERR(GTUtilsWorkflowDesigner::checkErrorList(os, "Read Tags") == 0, "Errors count dont match, should be 0 validation errors");
5031 }
GUI_TEST_CLASS_DEFINITION(test_2891_1)5032 GUI_TEST_CLASS_DEFINITION(test_2891_1) {
5033 // 1. Open file "data/samples/workflow_samples/NGS/cistrome/chip_seq.uwl"
5034 // 2. Set input file for the "Read Tags" element to "test/_common_data/regression/1587/some_image.png"
5035 // 3. Press the "Validate workflow" button on the main toolbar
5036 // Expected state: the message box about workflow errors has appeared. The "Error list" tab has appeared below the workflow
5037 // 4. Press "OK"
5038 // Expected state: there is a warning about possible incompatibilities of the "Read tags" element on the "Error list" tab
5039 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new StartupDialogFiller(os));
5040 GTFileDialog::openFile(os, dataDir + "/workflow_samples/NGS/cistrome/", "chip_seq.uwl");
5041 GTUtilsTaskTreeView::waitTaskFinished(os);
5042
5043 GTUtilsWorkflowDesigner::click(os, "Read Tags");
5044 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/regression/1587/some_image.png");
5045
5046 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
5047 GTWidget::click(os, GTAction::button(os, "Validate workflow"));
5048 CHECK_SET_ERR(GTUtilsWorkflowDesigner::checkErrorList(os, "Read Tags") == 1, "Errors count dont match, should be 1 validation error");
5049 }
5050
GUI_TEST_CLASS_DEFINITION(test_2894)5051 GUI_TEST_CLASS_DEFINITION(test_2894) {
5052 // Open {_common_data/clustal/100_sequences.aln}.
5053 GTFileDialog::openFile(os, testDir + "_common_data/clustal", "100_sequences.aln");
5054 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
5055
5056 GTUtilsProjectTreeView::toggleView(os); // close project tree view to get more space.
5057
5058 // Use context menu {Tree->Build Tree}.
5059 // Expected state: "Build phylogenetic tree" dialog has been appeared.
5060 GTUtilsDialog::waitForDialog(os, new BuildTreeDialogFiller(os, sandBoxDir + "test_2894_COI.nwk", 0, 0, true));
5061 GTWidget::click(os, GTAction::button(os, "Build Tree"));
5062 GTUtilsTaskTreeView::waitTaskFinished(os);
5063
5064 // Run "Phylip Neighbor Joining" with default parameters.
5065 // Expected state: tree view has been appeared.
5066 GTWidget::findWidget(os, "treeView");
5067
5068 // Press refresh tree button on the tree's toolbar.
5069 // Expected state: "Calculating Phylogenetic Tree" task has been started.
5070 GTWidget::click(os, GTAction::button(os, "Refresh tree"));
5071 GTUtilsTask::checkTask(os, "Calculating Phylogenetic Tree");
5072
5073 // Press refresh button again.
5074 // Expected state: a new refresh task is not started, the old one is in process.
5075 GTWidget::click(os, GTAction::button(os, "Refresh tree"));
5076
5077 int num = GTUtilsTaskTreeView::countTasks(os, "Calculating Phylogenetic Tree");
5078 CHECK_SET_ERR(num == 1, QString("Wrong tasks number. Expected 1, actual: ").arg(num));
5079 // Close the tree view while the task is performed.
5080 // Expected state: UGENE doesn't crash, view is closed, task cancels.
5081 GTUtilsProjectTreeView::click(os, "test_2894_COI.nwk");
5082
5083 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::No)); // Save the nwk file? Select 'No'.
5084 GTKeyboardDriver::keyClick(Qt::Key_Delete);
5085 }
5086
GUI_TEST_CLASS_DEFINITION(test_2895)5087 GUI_TEST_CLASS_DEFINITION(test_2895) {
5088 // 1. Open "_common_data/fasta/amino_multy.fa" as multiple alignment.
5089 // 2. Open "_common_data/fasta/amino_multy_ext.fa" as separate sequences.
5090 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Separate));
5091 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/amino_multy_ext.fa");
5092 GTUtilsTaskTreeView::waitTaskFinished(os);
5093 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Join));
5094 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/amino_multy.fa");
5095 GTUtilsTaskTreeView::waitTaskFinished(os);
5096 // 3. Try to add to the amino_multy.fa document, any sequence from the amino_multy_ext.fa document.
5097 GTUtilsDialog::waitForDialog(os, new ProjectTreeItemSelectorDialogFiller(os, "amino_multy_ext.fa", "chr1_gl000191_random Amino translation 0 direct"));
5098 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
5099 << "Add"
5100 << "Sequence from current project...");
5101 // Expected: an object will be added.
5102 }
5103
GUI_TEST_CLASS_DEFINITION(test_2897)5104 GUI_TEST_CLASS_DEFINITION(test_2897) {
5105 // 1. Open {data/samples/CLUSTALW/COI.aln}.
5106 GTFileDialog::openFile(os, dataDir + "/samples/CLUSTALW/", "COI.aln");
5107 GTUtilsMsaEditor::checkMsaEditorWindowIsActive(os);
5108
5109 // 2. Open options panel 'Highlighting' tab.
5110 GTUtilsOptionPanelMsa::openTab(os, GTUtilsOptionPanelMsa::Highlighting);
5111 GTUtilsOptionPanelMsa::checkTabIsOpened(os, GTUtilsOptionPanelMsa::Highlighting);
5112
5113 QComboBox *combo = qobject_cast<QComboBox *>(GTWidget::findWidget(os, "highlightingScheme"));
5114 CHECK_SET_ERR(combo != nullptr, "highlightingScheme not found!");
5115 int oldItemsNumber = combo->count();
5116
5117 // 3. Create a new custom nucleotide color scheme.
5118 QString colorSchemeName = GTUtils::genUniqueString(name);
5119 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_APPEARANCE << "Colors"
5120 << "Custom schemes"
5121 << "Create new color scheme"));
5122 GTUtilsDialog::waitForDialog(os, new NewColorSchemeCreator(os, colorSchemeName, NewColorSchemeCreator::nucl));
5123 MSAEditorSequenceArea *msaSeqArea = GTUtilsMSAEditorSequenceArea::getSequenceArea(os);
5124 GTMenu::showContextMenu(os, msaSeqArea);
5125
5126 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_APPEARANCE << "Colors"
5127 << "Custom schemes" << colorSchemeName));
5128 GTMenu::showContextMenu(os, msaSeqArea);
5129
5130 combo = qobject_cast<QComboBox *>(GTWidget::findWidget(os, "highlightingScheme"));
5131 CHECK_SET_ERR(combo != nullptr, "highlightingScheme not found!");
5132 int newItemsNumber = combo->count();
5133
5134 CHECK_SET_ERR(newItemsNumber == oldItemsNumber, "exportButton is disabled unexpectedly");
5135 }
5136
GUI_TEST_CLASS_DEFINITION(test_2899)5137 GUI_TEST_CLASS_DEFINITION(test_2899) {
5138 // 1. Start WD.
5139 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
5140 // 2. Open "RNA-seq analysis with Tuxedo tools" sample.
5141 // 3. Click the "Setup" button (default values: Full, Single-end).
5142 GTUtilsDialog::waitForDialog(os, new ConfigurationWizardFiller(os, "Configure Tuxedo Workflow", QStringList() << "Full"
5143 << "Single-end"));
5144
5145 class custom : public CustomScenario {
5146 public:
5147 void run(HI::GUITestOpStatus &os) {
5148 // 4. Go to the "Cuffmerge settings" page and click the "Defaults" button.
5149 QWidget *dialog = GTWidget::getActiveModalWidget(os);
5150 for (int i = 0; i < 4; i++) {
5151 GTUtilsWizard::clickButton(os, GTUtilsWizard::Next);
5152 }
5153 CHECK_SET_ERR(GTUtilsWizard::getPageTitle(os) == "Cuffmerge settings", "unexpected page");
5154 GTUtilsWizard::clickButton(os, GTUtilsWizard::Defaults);
5155
5156 // 5. Return to the "Tophat settings" page and set any file as Bowtie index (it might be valid Bowtie index or not).
5157 for (int i = 0; i < 2; i++) {
5158 GTUtilsWizard::clickButton(os, GTUtilsWizard::Back);
5159 }
5160
5161 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/bowtie2/index/human_T1_cutted.2.bt2"));
5162 GTWidget::click(os, GTWidget::findButtonByText(os, "Select\nbowtie index file", dialog));
5163 // Expected state: index is set if it is valid (file has valid extension), no crash
5164 bool basename = GTUtilsWizard::getParameter(os, "Bowtie index basename").toString() == "human_T1_cutted";
5165 bool dir = GTUtilsWizard::getParameter(os, "Bowtie index folder").toString().contains("_common_data/bowtie2/index");
5166 CHECK_SET_ERR(basename, "unexpected basename");
5167 CHECK_SET_ERR(dir, "unexpected dir");
5168 GTUtilsWizard::clickButton(os, GTUtilsWizard::Cancel);
5169 }
5170 };
5171
5172 GTUtilsDialog::waitForDialog(os, new WizardFiller(os, "Tuxedo Wizard", new custom()));
5173 GTUtilsWorkflowDesigner::addSample(os, "RNA-seq analysis with Tuxedo tools");
5174 }
5175
GUI_TEST_CLASS_DEFINITION(test_2900)5176 GUI_TEST_CLASS_DEFINITION(test_2900) {
5177 // 1. Open "samples/Genbank/murine.gb".
5178 GTFileDialog::openFile(os, dataDir + "samples/Genbank", "murine.gb");
5179 GTUtilsTaskTreeView::waitTaskFinished(os);
5180
5181 // Click "Hide zoom view"
5182 QWidget *toolbar = GTWidget::findWidget(os, "views_tool_bar_NC_001363");
5183 CHECK_SET_ERR(toolbar != nullptr, "Cannot find views_tool_bar_NC_001363");
5184 GTWidget::click(os, GTWidget::findWidget(os, "show_hide_zoom_view", toolbar));
5185
5186 // 2. Sequence view context menu -> Analyze -> Restriction sites.
5187 // 3. Press "OK".
5188 // Expected: the 8 regions of auto-annotations are created.
5189 const QStringList defaultEnzymes = QStringList() << "BamHI"
5190 << "BglII"
5191 << "ClaI"
5192 << "DraI"
5193 << "EcoRI"
5194 << "EcoRV"
5195 << "HindIII"
5196 << "PstI"
5197 << "SalI"
5198 << "SmaI"
5199 << "XmaI";
5200 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "ADV_MENU_ANALYSE"
5201 << "Find restriction sites"));
5202 GTUtilsDialog::waitForDialog(os, new FindEnzymesDialogFiller(os, defaultEnzymes));
5203 GTMenu::showContextMenu(os, GTUtilsSequenceView::getSeqWidgetByNumber(os));
5204
5205 GTUtilsTaskTreeView::waitTaskFinished(os);
5206 const int firstAnnotationsCount = GTUtilsAnnotationsTreeView::getAnnotationNamesOfGroup(os, "enzyme (8, 0)").size();
5207
5208 // 4. Repeast 2-3.
5209 // Expected: there are still 8 regions of auto-annotations. Old regions are removed, new ones are added.
5210 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "ADV_MENU_ANALYSE"
5211 << "Find restriction sites"));
5212 GTUtilsDialog::waitForDialog(os, new FindEnzymesDialogFiller(os, defaultEnzymes));
5213 GTMenu::showContextMenu(os, GTUtilsSequenceView::getSeqWidgetByNumber(os));
5214 GTUtilsTaskTreeView::waitTaskFinished(os);
5215 const int secondAnnotationsCount = GTUtilsAnnotationsTreeView::getAnnotationNamesOfGroup(os, "enzyme (8, 0)").size();
5216
5217 CHECK_SET_ERR(firstAnnotationsCount == secondAnnotationsCount, QString("Annotations count differs: %1 annotations in the first time, %2 annotations in the second time").arg(firstAnnotationsCount).arg(secondAnnotationsCount));
5218 }
5219
GUI_TEST_CLASS_DEFINITION(test_2903)5220 GUI_TEST_CLASS_DEFINITION(test_2903) {
5221 // 1. Open the attached file
5222 GTLogTracer l;
5223 GTFileDialog::openFile(os, testDir + "_common_data/regression/2903", "unknown_virus.fa");
5224 GTUtilsTaskTreeView::waitTaskFinished(os);
5225
5226 class Scenario : public CustomScenario {
5227 void run(HI::GUITestOpStatus &os) {
5228 GTWidget::getActiveModalWidget(os);
5229 GTKeyboardDriver::keyClick(Qt::Key_Enter);
5230 }
5231 };
5232
5233 // 2. Click on the Analyze->Query NCBI BLAST database context menu
5234 // 3. Click on the Search button
5235 // Expected state: the task starts with no errors
5236 // Current state: the following error appears: 'RemoteBLASTTask' task failed: Database couldn't prepare the response
5237 GTUtilsDialog::waitForDialog(os, new RemoteBLASTDialogFiller(os, new Scenario));
5238 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "ADV_MENU_ANALYSE"
5239 << "Query NCBI BLAST database"));
5240 GTMenu::showContextMenu(os, GTWidget::findWidget(os, "ren"
5241 "der_area_virus_X"));
5242 QString blastTaskName = "RemoteBLASTTask";
5243 GTUtilsTaskTreeView::checkTask(os, blastTaskName);
5244 GTGlobals::sleep(10000);
5245
5246 // Cancel the task. If not cancelled the run may last too long to trigger timeout in nightly tests.
5247 bool isTaskRunning = GTUtilsTaskTreeView::checkTask(os, blastTaskName);
5248 if (isTaskRunning) {
5249 GTUtilsTaskTreeView::cancelTask(os, blastTaskName);
5250 }
5251
5252 GTUtilsLog::check(os, l);
5253 }
5254
GUI_TEST_CLASS_DEFINITION(test_2907)5255 GUI_TEST_CLASS_DEFINITION(test_2907) {
5256 // 1. Open file _common_data/genbank/pBR322.gb
5257 GTFileDialog::openFile(os, testDir + "_common_data/genbank/", "pBR322.gb");
5258 GTUtilsTaskTreeView::waitTaskFinished(os);
5259
5260 // 2. In annotations tree view go to element Auto - annotations->enzyme->EcoRI(0, 1)->EcoRI
5261 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Restriction Sites"));
5262 QWidget *qt_toolbar_ext_button = GTWidget::findWidget(os, "qt_toolbar_ext_button", GTWidget::findWidget(os, "mwtoolbar_activemdi"), GTGlobals::FindOptions(false));
5263 if (qt_toolbar_ext_button != nullptr && qt_toolbar_ext_button->isVisible()) {
5264 GTWidget::click(os, qt_toolbar_ext_button);
5265 }
5266 GTWidget::click(os, GTWidget::findWidget(os, "toggleAutoAnnotationsButton"));
5267
5268 GTUtilsTaskTreeView::waitTaskFinished(os);
5269
5270 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "EcoRI"));
5271
5272 // 3. Stop cursor on EcoRI qualifier.Wait for tooltip
5273 // Expected state : tooltip will appear
5274 GTUtilsToolTip::checkExistingToolTip(os, "db_xref");
5275 }
5276
GUI_TEST_CLASS_DEFINITION(test_2910)5277 GUI_TEST_CLASS_DEFINITION(test_2910) {
5278 // 1. Open {data/samples/FASTA/human_T1.fa}.
5279 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
5280 GTUtilsTaskTreeView::waitTaskFinished(os);
5281
5282 // 2. Press Ctrl+A.
5283 // 3. Select a "Multiple Range Selection" mode, enter the region: 10000..15000
5284 // 4. Click the "Go" button.
5285
5286 GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os, "10000..15000"));
5287 GTKeyboardDriver::keyClick('A', Qt::ControlModifier);
5288
5289 // Expected state: the region is selected, there is a label "[5001 bp]" on the pan view.
5290 QVector<U2Region> reg = GTUtilsSequenceView::getSelection(os);
5291 CHECK_SET_ERR(reg.size() == 1, QString("unexpected number of selected regions: ").arg(reg.size()));
5292 CHECK_SET_ERR(reg.first().length == 5001, QString("unexpected selection length: ").arg(reg.first().length));
5293 CHECK_SET_ERR(reg.first().startPos == 9999, QString("unexpected selection start pos: ").arg(reg.first().startPos));
5294 }
GUI_TEST_CLASS_DEFINITION(test_2910_1)5295 GUI_TEST_CLASS_DEFINITION(test_2910_1) {
5296 // 1. Open {data/samples/FASTA/human_T1.fa}.
5297 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
5298 GTUtilsTaskTreeView::waitTaskFinished(os);
5299
5300 // 2. Press Ctrl+A.
5301 // 3. Select a "Multiple Range Selection" mode, enter the region: 2000..5000,100000..110000
5302 // 4. Click the "Go" button.
5303
5304 GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os, "2000..5000,100000..110000"));
5305 GTKeyboardDriver::keyClick('A', Qt::ControlModifier);
5306
5307 // Expected state: the region is selected, there is a label "[3001 bp]" and "[10001 bp]" on the pan view.
5308 QVector<U2Region> reg = GTUtilsSequenceView::getSelection(os);
5309 CHECK_SET_ERR(reg.size() == 2, QString("unexpected number of selected regions: ").arg(reg.size()));
5310 CHECK_SET_ERR(reg.first().length == 3001, QString("unexpected selection length: ").arg(reg.first().length));
5311 CHECK_SET_ERR(reg.first().startPos == 1999, QString("unexpected selection start pos: ").arg(reg.first().startPos));
5312
5313 CHECK_SET_ERR(reg.at(1).length == 10001, QString("unexpected selection length: ").arg(reg.at(1).length));
5314 CHECK_SET_ERR(reg.at(1).startPos == 99999, QString("unexpected selection start pos: ").arg(reg.at(1).startPos));
5315 }
5316
GUI_TEST_CLASS_DEFINITION(test_2910_2)5317 GUI_TEST_CLASS_DEFINITION(test_2910_2) {
5318 // 1. Open {data/samples/FASTA/human_T1.fa}.
5319 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
5320 GTUtilsTaskTreeView::waitTaskFinished(os);
5321
5322 // 2. Press Ctrl+A.
5323 // Expected state: a "Region Selection" dialog appeared.
5324 // 3. Select a "Multiple Range Selection" mode, enter the region: 0..5000
5325 // Expected state: the region is invalid, a "Go" button is disabled.
5326 class CancelClicker : public Filler {
5327 public:
5328 CancelClicker(HI::GUITestOpStatus &_os)
5329 : Filler(_os, "RangeSelectionDialog") {
5330 }
5331 virtual void run() {
5332 QWidget *w = GTWidget::getActiveModalWidget(os);
5333 QRadioButton *multipleButton = w->findChild<QRadioButton *>("miltipleButton");
5334 CHECK_SET_ERR(multipleButton != nullptr, "RadioButton \"miltipleButton\" not found");
5335 GTRadioButton::click(os, multipleButton);
5336
5337 QLineEdit *regionEdit = w->findChild<QLineEdit *>("multipleRegionEdit");
5338 CHECK_SET_ERR(regionEdit != nullptr, "QLineEdit \"multipleRegionEdit\" not foud");
5339 GTLineEdit::setText(os, regionEdit, "0..5000");
5340
5341 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
5342 CHECK_SET_ERR(nullptr != buttonBox, "button box is null");
5343 QPushButton *button = buttonBox->button(QDialogButtonBox::Cancel);
5344 CHECK_SET_ERR(nullptr != button, "cancel button is null");
5345 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
5346 CHECK_SET_ERR(!okButton->isEnabled(), "OK button is unexpectedly enabled");
5347 GTWidget::click(os, button);
5348 }
5349 };
5350 GTUtilsDialog::waitForDialog(os, new CancelClicker(os));
5351 GTKeyboardDriver::keyClick('A', Qt::ControlModifier);
5352 }
GUI_TEST_CLASS_DEFINITION(test_2910_3)5353 GUI_TEST_CLASS_DEFINITION(test_2910_3) {
5354 // 1. Open {data/samples/FASTA/human_T1.fa}.
5355 GTFileDialog::openFile(os, dataDir + "samples/FASTA", "human_T1.fa");
5356 GTUtilsTaskTreeView::waitTaskFinished(os);
5357
5358 // 2. Press Ctrl+A.
5359 // Expected state: a "Region Selection" dialog appeared.
5360 // 3. Select a "Multiple Range Selection" mode, enter the region: 1..199951
5361 // Expected state: the region is invalid, a "Go" button is disabled.
5362 class CancelClicker : public Filler {
5363 public:
5364 CancelClicker(HI::GUITestOpStatus &_os)
5365 : Filler(_os, "RangeSelectionDialog") {
5366 }
5367 virtual void run() {
5368 QWidget *w = GTWidget::getActiveModalWidget(os);
5369 QRadioButton *multipleButton = w->findChild<QRadioButton *>("miltipleButton");
5370 CHECK_SET_ERR(multipleButton != nullptr, "RadioButton \"miltipleButton\" not found");
5371 GTRadioButton::click(os, multipleButton);
5372
5373 QLineEdit *regionEdit = w->findChild<QLineEdit *>("multipleRegionEdit");
5374 CHECK_SET_ERR(regionEdit != nullptr, "QLineEdit \"multipleRegionEdit\" not foud");
5375 GTLineEdit::setText(os, regionEdit, "1..199951");
5376
5377 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
5378 CHECK_SET_ERR(nullptr != buttonBox, "button box is null");
5379 QPushButton *button = buttonBox->button(QDialogButtonBox::Cancel);
5380 CHECK_SET_ERR(nullptr != button, "cancel button is null");
5381 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
5382 CHECK_SET_ERR(!okButton->isEnabled(), "OK button is unexpectedly enabled");
5383 GTWidget::click(os, button);
5384 }
5385 };
5386 GTUtilsDialog::waitForDialog(os, new CancelClicker(os));
5387 GTKeyboardDriver::keyClick('a', Qt::ControlModifier);
5388 }
5389
GUI_TEST_CLASS_DEFINITION(test_2923)5390 GUI_TEST_CLASS_DEFINITION(test_2923) {
5391 // 1. Open "samples/FASTA/human_T1.fa".
5392 // Expected: the sequence view is opened.
5393 // 2. Press Ctrl+W.
5394 // Expected: the sequence view is closed.
5395
5396 // Close active view
5397 GTUtilsMdi::closeActiveWindow(os);
5398
5399 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
5400 GTUtilsTaskTreeView::waitTaskFinished(os);
5401 GTUtilsMdi::activeWindow(os);
5402
5403 GTKeyboardDriver::keyClick('w', Qt::ControlModifier);
5404 QWidget *mdi = GTUtilsMdi::activeWindow(os, GTGlobals::FindOptions(false));
5405 CHECK_SET_ERR(nullptr == mdi, "Sequence view is not closed");
5406 }
5407
GUI_TEST_CLASS_DEFINITION(test_2924)5408 GUI_TEST_CLASS_DEFINITION(test_2924) {
5409 // 1. Open "_common_data/scenarios/_regression/2924/human_T1_cutted.fa".
5410 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/2924/", "human_T1_cutted.fa");
5411 GTUtilsTaskTreeView::waitTaskFinished(os);
5412
5413 // 2. Open "_common_data/scenarios/_regression/2924/MyDocument_3.gb".
5414 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/2924/", "MyDocument_3.gb");
5415 GTUtilsTaskTreeView::waitTaskFinished(os);
5416
5417 // 3. Drag'n'drop the annotation object from the project to the sequence view.
5418 // Expected: the dialog appears.
5419 // 4. Click "OK".
5420 // Expected : the annotations are shown on the sequence view.
5421 GTUtilsDialog::waitForDialog(os, new CreateObjectRelationDialogFiller(os));
5422 GTUtilsProjectTreeView::dragAndDrop(os, GTUtilsProjectTreeView::findIndex(os, "Annotations"), GTUtilsAnnotationsTreeView::getTreeWidget(os));
5423
5424 // 5. Click the "Shown circular view" button on the sequence toolbar.
5425 // Expected : the circular view is shown.
5426 ADVSingleSequenceWidget *seqWidget = GTUtilsSequenceView::getSeqWidgetByNumber(os);
5427 GTUtilsCv::cvBtn::click(os, seqWidget);
5428
5429 // 6. Click the "Zoom in" button several times until it becomes disabled.
5430 // Expected : UGENE does not crash.
5431 QWidget *zoomInButton = GTAction::button(os, "tbZoomIn_human_T1 (UCSC April 2002 chr7:115977709-117855134) [human_T1_cutted.fa]");
5432
5433 while (zoomInButton->isEnabled()) {
5434 GTWidget::click(os, zoomInButton);
5435 }
5436 }
5437
GUI_TEST_CLASS_DEFINITION(test_2927)5438 GUI_TEST_CLASS_DEFINITION(test_2927) {
5439 // 1. Open file "data/samples/PDB/1CF7.PDB".
5440 GTFileDialog::openFile(os, dataDir + "samples/PDB/1CF7.PDB");
5441 GTUtilsTaskTreeView::waitTaskFinished(os);
5442
5443 // 2. Open file "data/samples/PDB/1CRN.PDB".
5444 GTFileDialog::openFile(os, dataDir + "samples/PDB/1CRN.PDB");
5445 GTUtilsTaskTreeView::waitTaskFinished(os);
5446
5447 // 3. Remove first document with delete key.
5448 GTUtilsProjectTreeView::click(os, "1CF7.PDB");
5449 GTKeyboardDriver::keyClick(Qt::Key_Delete);
5450 GTUtilsTaskTreeView::waitTaskFinished(os);
5451
5452 // 4. Press "Open" toolBar button.
5453 // Expected state: UGENE doesn't crash.
5454 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, dataDir + "samples/PDB/1CF7.PDB"));
5455 GTToolbar::clickButtonByTooltipOnToolbar(os, MWTOOLBAR_MAIN, "Open");
5456 }
5457
GUI_TEST_CLASS_DEFINITION(test_2929)5458 GUI_TEST_CLASS_DEFINITION(test_2929) {
5459 // 1. Open "human_T1.fa".
5460 // 2. Click the "Find TFBS with SITECON" button on the main toolbar
5461 // Expected state: a dialog appeared, model is not selected, threshold is not set.
5462 // 3. Click the "Search" button.
5463 // Expected state: an error message box appeared.
5464 // 4. Click the "Ok" button.
5465 // Expected state: the message box is closed, dialog is not accepted.
5466 // Current state: the message box is closed, UGENE crashed.
5467
5468 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
5469 GTUtilsTaskTreeView::waitTaskFinished(os);
5470
5471 class SiteconCustomFiller : public Filler {
5472 public:
5473 SiteconCustomFiller(HI::GUITestOpStatus &os)
5474 : Filler(os, "SiteconSearchDialog") {
5475 }
5476 virtual void run() {
5477 QWidget *dialog = GTWidget::getActiveModalWidget(os);
5478 QLineEdit *modelFileEdit = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "modelFileEdit"));
5479 CHECK_SET_ERR(modelFileEdit != nullptr, "modelFileEdit not found!");
5480 CHECK_SET_ERR(modelFileEdit->text().isEmpty(), "Model is set!");
5481
5482 QComboBox *errComboBox = qobject_cast<QComboBox *>(GTWidget::findWidget(os, "errLevelBox"));
5483 CHECK_SET_ERR(errComboBox->currentText().isEmpty(), "Threshold is set!");
5484
5485 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
5486 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
5487
5488 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
5489 }
5490 };
5491
5492 GTUtilsDialog::waitForDialog(os, new SiteconCustomFiller(os));
5493 GTWidget::click(os, GTWidget::findWidget(os, "SITECON_widget"));
5494 }
5495
GUI_TEST_CLASS_DEFINITION(test_2930)5496 GUI_TEST_CLASS_DEFINITION(test_2930) {
5497 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, sandBoxDir + "test_2930"));
5498 GTUtilsProject::openFile(os, dataDir + "samples/ACE/K26.ace");
5499 GTUtilsTaskTreeView::waitTaskFinished(os);
5500
5501 GTUtilsProject::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
5502 GTUtilsTaskTreeView::waitTaskFinished(os);
5503 }
5504
GUI_TEST_CLASS_DEFINITION(test_2931)5505 GUI_TEST_CLASS_DEFINITION(test_2931) {
5506 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, sandBoxDir + "test_2931"));
5507 GTUtilsProject::openFile(os, dataDir + "samples/ACE/K26.ace");
5508 GTUtilsTaskTreeView::waitTaskFinished(os);
5509 GTUtilsTaskTreeView::waitTaskFinished(os);
5510
5511 GTLogTracer l;
5512 GTUtilsDialog::waitForDialog(os, new ConvertAssemblyToSAMDialogFiller(os, sandBoxDir, "test_2931"));
5513 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
5514 << "NGS data analysis"
5515 << "Convert UGENE assembly database to SAM...");
5516
5517 CHECK_SET_ERR(!l.hasErrors(), "Errors in log: " + l.getJoinedErrorString());
5518 }
5519
GUI_TEST_CLASS_DEFINITION(test_2945)5520 GUI_TEST_CLASS_DEFINITION(test_2945) {
5521 // 1. Open file with annotations, e.g. murine.db
5522 // 2. Open Circular View(CV)
5523 // 3. Move the splitter between CV and Sequence View(SV) up to hide CV (CV action button is still active)
5524 // 4. Move the splitter between Sequence View and Annotation Tree View down.
5525 // expected state: CV appeared. all parts of CV are visiable
5526
5527 // New state of UGENE: seq.view is resizable now, so CV will not be visible by dragging splitter between SV and AE
5528
5529 GTFileDialog::openFile(os, dataDir + "/samples/Genbank", "murine.gb");
5530 GTUtilsTaskTreeView::waitTaskFinished(os);
5531 GTWidget::click(os, GTAction::button(os, "CircularViewAction"));
5532 QWidget *zoomIn = GTAction::button(os, "tbZoomIn_NC_001363 [murine.gb]");
5533 CHECK_SET_ERR(zoomIn != nullptr, "zoomIn action on CV not found");
5534
5535 QWidget *splitterHandler = GTWidget::findWidget(os, "qt_splithandle_annotated_DNA_scrollarea");
5536 CHECK_SET_ERR(splitterHandler != nullptr, "SplitterHandle not found");
5537 GTWidget::click(os, splitterHandler);
5538
5539 QWidget *mainToolBar = GTWidget::findWidget(os, "mwtoolbar_activemdi");
5540 CHECK_SET_ERR(mainToolBar != nullptr, "mwtoolbar_activemdi not found");
5541 QPoint bottomLeftToolBar = mainToolBar->geometry().bottomLeft();
5542 bottomLeftToolBar = mainToolBar->mapToGlobal(bottomLeftToolBar);
5543
5544 GTMouseDriver::press();
5545 GTMouseDriver::moveTo(bottomLeftToolBar);
5546 GTMouseDriver::release();
5547 GTThread::waitForMainThread();
5548 QPoint handlePosition = splitterHandler->pos();
5549
5550 QAbstractButton *cvButton = GTAction::button(os, "CircularViewAction");
5551 CHECK_SET_ERR(cvButton->isChecked(), "CV button is not checked!");
5552
5553 QSplitter *splitter = qobject_cast<QSplitter *>(GTWidget::findWidget(os, "annotated_DNA_splitter"));
5554 CHECK_SET_ERR(splitter != nullptr, "annotated_DNA_splitter not found");
5555 int idx = splitter->indexOf(GTWidget::findWidget(os, "annotations_tree_view"));
5556 QSplitterHandle *handle = splitter->handle(idx);
5557 CHECK_SET_ERR(handle != nullptr, "SplitterHadle not found");
5558
5559 GTWidget::click(os, handle);
5560
5561 QPoint p = GTMouseDriver::getMousePosition();
5562 GTMouseDriver::press();
5563 GTMouseDriver::moveTo(p + QPoint(0, 50));
5564 GTMouseDriver::release();
5565 GTThread::waitForMainThread();
5566
5567 CHECK_SET_ERR(handlePosition == splitterHandler->pos(), QString("Handler was moved: expected: %1, actual: %2").arg(splitter->pos().y()).arg(handlePosition.y()));
5568 }
5569
GUI_TEST_CLASS_DEFINITION(test_2951)5570 GUI_TEST_CLASS_DEFINITION(test_2951) {
5571 // 1. Open WD.
5572 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
5573
5574 // 2. Click the "Scripting mode" tool button -> Show scripting options.
5575 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Show scripting options"));
5576 GTWidget::click(os, GTAction::button(os, GTAction::findActionByText(os, "Scripting mode")));
5577
5578 // 3. Create the workflow: "Read sequence" -> "Write sequence".
5579 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
5580 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Sequence", true);
5581 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence"), GTUtilsWorkflowDesigner::getWorker(os, "Write Sequence"));
5582
5583 // 4. Set the input sequence: _common_data/fasta/abcd.fa.
5584 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
5585 GTMouseDriver::click();
5586 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/fasta/abcd.fa");
5587
5588 // 5. Set the correct output sequence.
5589 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Write Sequence"));
5590 GTMouseDriver::click();
5591 QString outFile = GUrl(sandBoxDir + "test_2951.gb").getURLString();
5592 GTUtilsWorkflowDesigner::setParameter(os, "Output file", outFile, GTUtilsWorkflowDesigner::textValue);
5593
5594 // 6. Edit a script for "Sequence count limit":
5595 // printToLog("test");
5596 // 1
5597 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "Read Sequence"));
5598 GTMouseDriver::click();
5599 GTUtilsDialog::waitForDialog(os, new ScriptEditorDialogFiller(os, "", "printToLog(\"test message\");\n1"));
5600 GTUtilsWorkflowDesigner::setParameterScripting(os, "Sequence count limit", "user script");
5601
5602 // Expected: the result file contains only the first sequence from the input file; there is a message "test" in the script details log.
5603 GTWidget::click(os, GTAction::button(os, "Run workflow"));
5604 GTUtilsTaskTreeView::waitTaskFinished(os);
5605 bool printed = GTLogTracer::checkMessage("test message");
5606 CHECK_SET_ERR(printed, "No message in the log");
5607
5608 GTUtilsProject::openFile(os, outFile);
5609 QModelIndex objIdx = GTUtilsProjectTreeView::findIndex(os, "d");
5610 QTreeView *tree = GTUtilsProjectTreeView::getTreeView(os);
5611 int objectsCount = tree->model()->rowCount(objIdx.parent());
5612 CHECK_SET_ERR(1 == objectsCount, "More than one objects in the result");
5613 }
5614
GUI_TEST_CLASS_DEFINITION(test_2962_1)5615 GUI_TEST_CLASS_DEFINITION(test_2962_1) {
5616 // 1. Open "_common_data/scenarios/_regression/2924/human_T1_cutted.fa".
5617 // 2. Click the "Shown circular view" button on the sequence toolbar.
5618 // Expected: the circular view is shown.
5619 // 3. Unload project.
5620 // 4. Repeat 1,2.
5621 // Expected: UGENE does not crash.
5622
5623 GTLogTracer l;
5624 ADVSingleSequenceWidget *seqWidget =
5625 GTUtilsProject::openFileExpectSequence(os,
5626 testDir + "_common_data/scenarios/_regression/2924",
5627 "human_T1_cutted.fa",
5628 "human_T1 (UCSC April 2002 chr7:115977709-117855134)");
5629 GTUtilsCv::cvBtn::click(os, seqWidget);
5630
5631 CHECK_SET_ERR(GTUtilsCv::cvBtn::isChecked(os, seqWidget), "Unexpected state of CV button!");
5632 CHECK_SET_ERR(GTUtilsCv::isCvPresent(os, seqWidget), "Unexpected state of CV widget!");
5633
5634 GTUtilsDialog::waitForDialog(os, new SaveProjectDialogFiller(os, QDialogButtonBox::No));
5635 GTMenu::clickMainMenuItem(os, QStringList() << "File"
5636 << "Close project",
5637 GTGlobals::UseMouse);
5638
5639 seqWidget = GTUtilsProject::openFileExpectSequence(os,
5640 testDir + "_common_data/scenarios/_regression/2924",
5641 "human_T1_cutted.fa",
5642 "human_T1 (UCSC April 2002 chr7:115977709-117855134)");
5643 GTUtilsCv::cvBtn::click(os, seqWidget);
5644 CHECK_SET_ERR(GTUtilsCv::cvBtn::isChecked(os, seqWidget), "Unexpected state of CV button!");
5645 CHECK_SET_ERR(GTUtilsCv::isCvPresent(os, seqWidget), "Unexpected state of CV widget!");
5646
5647 GTUtilsLog::check(os, l);
5648 }
5649
GUI_TEST_CLASS_DEFINITION(test_2962_2)5650 GUI_TEST_CLASS_DEFINITION(test_2962_2) {
5651 // Open "_common_data/fasta/DNA.fa".
5652 // Remove the second sequence object from the document.
5653 // Click the "Toggle circular views" button on the main toolbar.
5654 // Expected state: the circular view is toggled it is possible.
5655 // Current state: UGENE crashes.
5656
5657 GTLogTracer l;
5658
5659 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os));
5660 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/DNA.fa");
5661 GTUtilsTaskTreeView::waitTaskFinished(os);
5662
5663 QPoint p = GTUtilsProjectTreeView::getItemCenter(os, "GXL_141618");
5664 GTMouseDriver::moveTo(p);
5665 GTMouseDriver::click();
5666
5667 GTKeyboardDriver::keyClick(Qt::Key_Delete);
5668 GTUtilsCv::commonCvBtn::click(os);
5669
5670 GTUtilsLog::check(os, l);
5671 }
5672
GUI_TEST_CLASS_DEFINITION(test_2971)5673 GUI_TEST_CLASS_DEFINITION(test_2971) {
5674 /* 1. Open "COI.aln".
5675 2. Context menu -> Add -> Sequence from file...
5676 3. Choose a file with a large sequence (~50mb), e.g human chr21.
5677 Expected: UGENE does not crash.
5678 */
5679 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
5680 GTUtilsTaskTreeView::waitTaskFinished(os);
5681
5682 GTWidget::click(os, GTAction::button(os, "Show overview")); // needed to swith off rendering overview
5683 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/regression/2971", "hg18_21.fa"));
5684 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "MSAE_MENU_LOAD_SEQ"
5685 << "Sequence from file"));
5686 GTWidget::click(os, GTUtilsMdi::activeWindow(os), Qt::RightButton);
5687 GTUtilsTaskTreeView::waitTaskFinished(os);
5688 // Close file - UGENE does not crash.
5689 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::No));
5690 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "COI.aln"));
5691 GTMouseDriver::click();
5692 GTKeyboardDriver::keyClick(Qt::Key_Delete);
5693 }
5694
GUI_TEST_CLASS_DEFINITION(test_2972)5695 GUI_TEST_CLASS_DEFINITION(test_2972) {
5696 // 1. Open "samples/FASTA/human_T1.fa".
5697 GTLogTracer l;
5698 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
5699 GTUtilsTaskTreeView::waitTaskFinished(os);
5700 // 2. Click the menu Tools -> HMMER tools -> HMM3 -> Search with HMM3 phmmer.
5701 GTUtilsDialog::waitForDialog(os, new UHMM3PhmmerDialogFiller(os, dataDir + "samples/Newick/COI.nwk"));
5702 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
5703 << "HMMER tools"
5704 << "Search with phmmer...");
5705
5706 CHECK_SET_ERR(l.hasErrors(), "Expected to have errors in the log, but no errors found");
5707 QString error = l.getJoinedErrorString();
5708 #ifdef Q_OS_WIN
5709 QString expectedError = "Task {Search with phmmer} finished with error: Subtask {PHMMER search tool} is failed";
5710 #else
5711 QString expectedError = "is empty or misformatted";
5712 #endif
5713
5714 CHECK_SET_ERR(error.contains(expectedError), "actual error is " + error);
5715 // 3. Choose the query sequence file: any non-sequence format file (e.g. *.mp3).
5716 // 4. Click search.
5717 // Expected state: the search task fails, UGENE does not crash.
5718 }
5719
GUI_TEST_CLASS_DEFINITION(test_2975)5720 GUI_TEST_CLASS_DEFINITION(test_2975) {
5721 // 1. Open "_common_data/fasta/all_alphabet.fa" as multiple alignment.
5722 GTUtilsProject::openMultiSequenceFileAsMalignment(os, testDir + "_common_data/fasta", "all_and_raw_alphabets.fa");
5723
5724 // 2. Open the "Pairwise alignment" options panel tab.
5725 GTUtilsOptionPanelMsa::openTab(os, GTUtilsOptionPanelMsa::PairwiseAlignment);
5726
5727 // 3. Set the first sequence as the first sequence and the second sequence as the second sequence, select the "Smith-Waterman" algorithm.
5728 // Expected state: align button is blocked
5729 GTUtilsOptionPanelMsa::addFirstSeqToPA(os, "Dna");
5730 GTUtilsOptionPanelMsa::addSecondSeqToPA(os, "Raw");
5731 GTUtilsOptionPanelMsa::setPairwiseAlignmentAlgorithm(os, "Smith-Waterman");
5732
5733 QPushButton *alignButton = GTUtilsOptionPanelMsa::getAlignButton(os);
5734 CHECK_SET_ERR(nullptr != alignButton, "Align button is NULL");
5735 CHECK_SET_ERR(!alignButton->isEnabled(), "Align button is unexpectedly enabled");
5736 }
5737
GUI_TEST_CLASS_DEFINITION(test_2981)5738 GUI_TEST_CLASS_DEFINITION(test_2981) {
5739 // 1. Open "data/samples/CLUSTALW/COI.aln".
5740 GTFileDialog::openFile(os, dataDir + "/samples/CLUSTALW/", "COI.aln");
5741 GTUtilsTaskTreeView::waitTaskFinished(os);
5742 // 2. Click a "Build Tree" button on the main toolbar.
5743 GTUtilsDialog::waitForDialog(os, new BuildTreeDialogFiller(os, sandBoxDir + "test_3276_COI.wnk", 0, 0, true));
5744 GTWidget::click(os, GTAction::button(os, "Build Tree"));
5745 GTUtilsTaskTreeView::waitTaskFinished(os);
5746 // Expected state: a "Build Phyligenetic Tree" dialog appears.
5747
5748 // 3. Set any acceptable path and build a tree with default parameters.
5749 // Expected state: the tree is shown in the MSA Editor.
5750
5751 // 4. Click a "Layout" button on the tree view toolbar, select a "Circular" menu item.
5752 QComboBox *layoutCombo = GTWidget::findExactWidget<QComboBox *>(os, "layoutCombo");
5753 GTComboBox::selectItemByText(os, layoutCombo, "Circular");
5754 // Expected state: the tree becomes circular.
5755 QGraphicsView *treeView = GTWidget::findExactWidget<QGraphicsView *>(os, "treeView");
5756 int initW = treeView->rect().width();
5757 // 5. Hide/show a project view.
5758 GTKeyboardDriver::keyClick('1', Qt::AltModifier);
5759 GTKeyboardDriver::keyClick('1', Qt::AltModifier);
5760 // Expected state: the tree size is not changed.
5761 int finalW = treeView->rect().width();
5762 CHECK_SET_ERR(finalW == initW, QString("initial: %1, final: %2").arg(initW).arg(finalW));
5763 }
5764
GUI_TEST_CLASS_DEFINITION(test_2987)5765 GUI_TEST_CLASS_DEFINITION(test_2987) {
5766 // 1. Open "_common_data/fasta/RAW.fa".
5767 // 2. Create a complement annotation.
5768 // 3. Select {Actions -> Export -> Export annotations...} in the main menu.
5769 // 4. Fill the dialog:
5770 // "Export to file" - any valid file;
5771 // "File format" - csv;
5772 // "Save sequences under annotations" - checked
5773 // and click the "Ok" button.
5774 // Expected state: annotations are successfully exported.
5775 GTLogTracer logTracer;
5776
5777 GTFileDialog::openFile(os, testDir + "_common_data/fasta", "RAW2.fa");
5778 GTUtilsTaskTreeView::waitTaskFinished(os);
5779
5780 QDir().mkpath(sandBoxDir + "test_3305");
5781 GTUtilsDialog::waitForDialog(os, new CreateAnnotationWidgetFiller(os, true, "<auto>", "misc_feature", "complement(1..5)", sandBoxDir + "test_2987/test_2987.gb"));
5782 GTWidget::click(os, GTToolbar::getWidgetForActionObjectName(os, GTToolbar::getToolbar(os, MWTOOLBAR_ACTIVEMDI), "create_annotation_action"));
5783
5784 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ACTION_PROJECT__EXPORT_IMPORT_MENU_ACTION << "ep_exportAnnotations2CSV"));
5785 GTUtilsDialog::waitForDialog(os, new ExportAnnotationsFiller(sandBoxDir + "test_2987/test_2987", ExportAnnotationsFiller::csv, os));
5786 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "test_2987.gb"));
5787 GTMouseDriver::click(Qt::RightButton);
5788
5789 const QFile csvFile(sandBoxDir + "test_2987/test_2987");
5790 CHECK_SET_ERR(!(csvFile.exists() && csvFile.size() == 0), "An empty file exists");
5791 }
5792
GUI_TEST_CLASS_DEFINITION(test_2991)5793 GUI_TEST_CLASS_DEFINITION(test_2991) {
5794 /* 1. Open file _common_data/alphabets/extended_amino_1000.fa
5795 Expected state: Alphabet of opened sequence must be [amino ext]
5796 */
5797 GTFileDialog::openFile(os, testDir + "_common_data/alphabets/", "extended_amino_1000.fa");
5798 GTUtilsTaskTreeView::waitTaskFinished(os);
5799 QWidget *w = GTWidget::findWidget(os, "ADV_single_sequence_widget_0");
5800 QLabel *label = qobject_cast<QLabel *>(GTWidget::findWidget(os, "nameLabel", w));
5801 CHECK_SET_ERR(label->text().contains("[amino ext]"), QString("Unexpected label of sequence name: %1, must contain %2").arg(label->text()).arg("[amino ext]"));
5802 }
5803
GUI_TEST_CLASS_DEFINITION(test_2998)5804 GUI_TEST_CLASS_DEFINITION(test_2998) {
5805 // 1. Open human_T1.fa
5806 GTLogTracer l;
5807 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
5808 GTUtilsTaskTreeView::waitTaskFinished(os);
5809
5810 // 2. Find any pattern
5811 GTUtilsOptionsPanel::runFindPatternWithHotKey("TTTTTAAAAA", os);
5812
5813 // Expected state: the task will finished without errors.
5814 GTUtilsLog::check(os, l);
5815 }
5816
5817 } // namespace GUITest_regression_scenarios
5818
5819 } // namespace U2
5820