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 "GTTestsRegressionScenarios_1_1000.h"
23 #include <base_dialogs/DefaultDialogFiller.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/GTCheckBox.h>
29 #include <primitives/GTComboBox.h>
30 #include <primitives/GTGroupBox.h>
31 #include <primitives/GTLineEdit.h>
32 #include <primitives/GTListWidget.h>
33 #include <primitives/GTMainWindow.h>
34 #include <primitives/GTPlainTextEdit.h>
35 #include <primitives/GTRadioButton.h>
36 #include <primitives/GTSpinBox.h>
37 #include <primitives/GTTabWidget.h>
38 #include <primitives/GTTableView.h>
39 #include <primitives/GTToolbar.h>
40 #include <primitives/GTTreeWidget.h>
41 #include <primitives/GTWidget.h>
42
43 #include <QDialogButtonBox>
44 #include <QFileDialog>
45 #include <QHeaderView>
46 #include <QListWidget>
47 #include <QMainWindow>
48 #include <QMenu>
49 #include <QPlainTextEdit>
50 #include <QPushButton>
51 #include <QTableWidget>
52 #include <QTextStream>
53 #include <QWizard>
54
55 #include <U2Core/AppContext.h>
56 #include <U2Core/ExternalToolRegistry.h>
57 #include <U2Core/U2ObjectDbi.h>
58
59 #include <U2View/ADVConstants.h>
60 #include <U2View/ADVSingleSequenceWidget.h>
61 #include <U2View/AnnotationsTreeView.h>
62 #include <U2View/DetView.h>
63 #include <U2View/GSequenceGraphView.h>
64 #include <U2View/MSAEditor.h>
65 #include <U2View/MaEditorNameList.h>
66
67 #include "../../workflow_designer/src/WorkflowViewItems.h"
68 #include "GTDatabaseConfig.h"
69 #include "GTGlobals.h"
70 #include "GTUtilsAnnotationsTreeView.h"
71 #include "GTUtilsAssemblyBrowser.h"
72 #include "GTUtilsBookmarksTreeView.h"
73 #include "GTUtilsDashboard.h"
74 #include "GTUtilsExternalTools.h"
75 #include "GTUtilsLog.h"
76 #include "GTUtilsMdi.h"
77 #include "GTUtilsMsaEditorSequenceArea.h"
78 #include "GTUtilsNotifications.h"
79 #include "GTUtilsOptionPanelSequenceView.h"
80 #include "GTUtilsOptionsPanel.h"
81 #include "GTUtilsProject.h"
82 #include "GTUtilsProjectTreeView.h"
83 #include "GTUtilsSequenceView.h"
84 #include "GTUtilsSharedDatabaseDocument.h"
85 #include "GTUtilsTask.h"
86 #include "GTUtilsTaskTreeView.h"
87 #include "GTUtilsWorkflowDesigner.h"
88 #include "api/GTSequenceReadingModeDialog.h"
89 #include "api/GTSequenceReadingModeDialogUtils.h"
90 #include "primitives/GTAction.h"
91 #include "primitives/GTMenu.h"
92 #include "primitives/PopupChooser.h"
93 #include "runnables/ugene/corelibs/U2Gui/AlignShortReadsDialogFiller.h"
94 #include "runnables/ugene/corelibs/U2Gui/AppSettingsDialogFiller.h"
95 #include "runnables/ugene/corelibs/U2Gui/CreateAnnotationWidgetFiller.h"
96 #include "runnables/ugene/corelibs/U2Gui/CreateDocumentFromTextDialogFiller.h"
97 #include "runnables/ugene/corelibs/U2Gui/CreateObjectRelationDialogFiller.h"
98 #include "runnables/ugene/corelibs/U2Gui/EditConnectionDialogFiller.h"
99 #include "runnables/ugene/corelibs/U2Gui/EditSequenceDialogFiller.h"
100 #include "runnables/ugene/corelibs/U2Gui/FindQualifierDialogFiller.h"
101 #include "runnables/ugene/corelibs/U2Gui/FindTandemsDialogFiller.h"
102 #include "runnables/ugene/corelibs/U2Gui/GraphSettingsDialogFiller.h"
103 #include "runnables/ugene/corelibs/U2Gui/ImportACEFileDialogFiller.h"
104 #include "runnables/ugene/corelibs/U2Gui/ImportBAMFileDialogFiller.h"
105 #include "runnables/ugene/corelibs/U2Gui/PredictSecondaryStructureDialogFiller.h"
106 #include "runnables/ugene/corelibs/U2Gui/ProjectTreeItemSelectorDialogFiller.h"
107 #include "runnables/ugene/corelibs/U2Gui/RangeSelectionDialogFiller.h"
108 #include "runnables/ugene/corelibs/U2Gui/ReplaceSubsequenceDialogFiller.h"
109 #include "runnables/ugene/corelibs/U2View/ov_assembly/ExportConsensusDialogFiller.h"
110 #include "runnables/ugene/corelibs/U2View/ov_msa/ExtractSelectedAsMSADialogFiller.h"
111 #include "runnables/ugene/corelibs/U2View/ov_msa/LicenseAgreementDialogFiller.h"
112 #include "runnables/ugene/corelibs/U2View/utils_smith_waterman/SmithWatermanDialogBaseFiller.h"
113 #include "runnables/ugene/plugins/annotator/FindAnnotationCollocationsDialogFiller.h"
114 #include "runnables/ugene/plugins/cap3/CAP3SupportDialogFiller.h"
115 #include "runnables/ugene/plugins/dna_export/ExportAnnotationsDialogFiller.h"
116 #include "runnables/ugene/plugins/dna_export/ExportSequences2MSADialogFiller.h"
117 #include "runnables/ugene/plugins/dna_export/ExportSequencesDialogFiller.h"
118 #include "runnables/ugene/plugins/dna_export/ImportAnnotationsToCsvFiller.h"
119 #include "runnables/ugene/plugins/enzymes/ConstructMoleculeDialogFiller.h"
120 #include "runnables/ugene/plugins/enzymes/CreateFragmentDialogFiller.h"
121 #include "runnables/ugene/plugins/enzymes/DigestSequenceDialogFiller.h"
122 #include "runnables/ugene/plugins/enzymes/EditFragmentDialogFiller.h"
123 #include "runnables/ugene/plugins/enzymes/FindEnzymesDialogFiller.h"
124 #include "runnables/ugene/plugins/external_tools/BlastAllSupportDialogFiller.h"
125 #include "runnables/ugene/plugins/weight_matrix/PwmBuildDialogFiller.h"
126 #include "runnables/ugene/plugins/weight_matrix/PwmSearchDialogFiller.h"
127 #include "runnables/ugene/plugins/workflow_designer/CreateElementWithCommandLineToolFiller.h"
128 #include "runnables/ugene/plugins/workflow_designer/CreateElementWithScriptDialogFiller.h"
129 #include "runnables/ugene/plugins_3rdparty/clustalw/ClustalWDialogFiller.h"
130 #include "runnables/ugene/plugins_3rdparty/kalign/KalignDialogFiller.h"
131 #include "runnables/ugene/plugins_3rdparty/umuscle/MuscleDialogFiller.h"
132 #include "runnables/ugene/ugeneui/DocumentFormatSelectorDialogFiller.h"
133 #include "runnables/ugene/ugeneui/SequenceReadingModeSelectorDialogFiller.h"
134 #include "system/GTClipboard.h"
135 #include "system/GTFile.h"
136 #include "utils/GTThread.h"
137 #include "utils/GTUtilsDialog.h"
138
139 namespace U2 {
140
141 namespace GUITest_regression_scenarios {
142
GUI_TEST_CLASS_DEFINITION(test_0057_1)143 GUI_TEST_CLASS_DEFINITION(test_0057_1) {
144 // Crash on a number of multisequence files opening in the merge mode
145 // 1. Open samples/Genbank/sars.gb.
146 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
147 GTUtilsTaskTreeView::waitTaskFinished(os);
148
149 // 2. Click the right mouse button on NC_001363 annotations tree view and select menu item "Find qualifier"
150 // Expected state : Opened "Find Qualifier" dialog.
151 // 3. Enter to Name field 'db_xref' and click "Next" button
152 FindQualifierFiller::FindQualifierFillerSettings settings("db_xref", QString(), false, true, 1, false, false, false);
153 GTUtilsDialog::waitForDialog(os, new FindQualifierFiller(os, settings));
154 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Find qualifier..."));
155 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "NC_004718 features [sars.gb]"));
156 GTMouseDriver::click(Qt::RightButton);
157
158 // Expected state : Found first qualifier with name db_xref and value GI:30124074
159 QList<QTreeWidgetItem *> selectedItems = GTUtilsAnnotationsTreeView::getAllSelectedItems(os);
160 CHECK_SET_ERR(2 == selectedItems.size(), "Unexpected number of selected items");
161 const QString qualifierName = selectedItems[1]->data(0, Qt::DisplayRole).toString();
162 CHECK_SET_ERR("db_xref" == qualifierName, "Unexpected qualifier name");
163 const QString qualifierType = selectedItems[1]->data(1, Qt::DisplayRole).toString();
164 CHECK_SET_ERR(qualifierType.isEmpty(), "Qualifier unexpectedly has a type");
165 const QString qualifierValue = selectedItems[1]->data(2, Qt::DisplayRole).toString();
166 CHECK_SET_ERR("GI:30124074" == qualifierValue, "Unexpected qualifier value");
167 }
168
GUI_TEST_CLASS_DEFINITION(test_0057_2)169 GUI_TEST_CLASS_DEFINITION(test_0057_2) {
170 // Crash on a number of multisequence files opening in the merge mode
171 // 1. Open samples/Genbank/sars.gb.
172 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
173 GTUtilsTaskTreeView::waitTaskFinished(os);
174
175 // 2. Click on right mouse button on NC_001363 annotations tree view and select menu item "Find qualifier"
176 // Expected state : Opened "Find Qualifier" dialog.
177 // 3. Enter to Name field 'db_xref' and click "Select All" button
178 FindQualifierFiller::FindQualifierFillerSettings settings("db_xref", QString(), false, true);
179 GTUtilsDialog::waitForDialog(os, new FindQualifierFiller(os, settings));
180 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Find qualifier..."));
181 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "NC_004718 features [sars.gb]"));
182 GTMouseDriver::click(Qt::RightButton);
183
184 // Expected state : Selected 58 qualifiers with name db_xref
185 QList<QTreeWidgetItem *> selectedItems = GTUtilsAnnotationsTreeView::getAllSelectedItems(os);
186 int qualifiersCount = 0;
187 const QString expectedQualifierName = "db_xref";
188
189 foreach (QTreeWidgetItem *item, selectedItems) {
190 AVQualifierItem *qualifierItem = dynamic_cast<AVQualifierItem *>(item);
191 if (nullptr != qualifierItem) {
192 qualifiersCount++;
193 const QString qualifierName = item->data(0, Qt::DisplayRole).toString();
194 CHECK_SET_ERR(expectedQualifierName == qualifierName, QString("Unexpected qualifier name: expect '%1', got '%2'").arg(expectedQualifierName).arg(qualifierName));
195 }
196 }
197
198 CHECK_SET_ERR(58 == qualifiersCount, "Unexpected number of selected items");
199 }
200
GUI_TEST_CLASS_DEFINITION(test_0057_3)201 GUI_TEST_CLASS_DEFINITION(test_0057_3) {
202 // Crash on a number of multisequence files opening in the merge mode
203 // 1. Open samples / Genbank / murine.gb.
204 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
205 GTUtilsTaskTreeView::waitTaskFinished(os);
206
207 // 2. Click on right mouse button on NC_001363 annotations tree view and select menu item "Find qualifier"
208 // Expected state : Opened "Find Qualifier" dialog.
209 // 3. Enter to Value field 'pol polyprotein fragment' and click "Next" button
210 FindQualifierFiller::FindQualifierFillerSettings settings(QString(), "pol polyprotein fragment", false, true, 1, false, false);
211 GTUtilsDialog::waitForDialog(os, new FindQualifierFiller(os, settings));
212 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Find qualifier..."));
213 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "NC_001363 features [murine.gb]"));
214 GTMouseDriver::click(Qt::RightButton);
215
216 // Expected state : Founded first qualifier with name 'product' and value 'pol polyprotein fragment'
217 QList<QTreeWidgetItem *> selectedItems = GTUtilsAnnotationsTreeView::getAllSelectedItems(os);
218 CHECK_SET_ERR(2 == selectedItems.size(), "Unexpected number of selected items");
219 const QString qualifierName = selectedItems[1]->data(0, Qt::DisplayRole).toString();
220 CHECK_SET_ERR("product" == qualifierName, "Unexpected qualifier name");
221 const QString qualifierType = selectedItems[1]->data(1, Qt::DisplayRole).toString();
222 CHECK_SET_ERR(qualifierType.isEmpty(), "Qualifier unexpectedly has a type");
223 const QString qualifierValue = selectedItems[1]->data(2, Qt::DisplayRole).toString();
224 CHECK_SET_ERR("pol polyprotein fragment" == qualifierValue, "Unexpected qualifier value");
225 }
226
GUI_TEST_CLASS_DEFINITION(test_0057_4)227 GUI_TEST_CLASS_DEFINITION(test_0057_4) {
228 // Crash on a number of multisequence files opening in the merge mode
229 // 1. Open samples/Genbank/murine.gb.
230 // 2. Click on right mouse button on NC_001363 annotations tree view and select menu item "Find qualifier"
231 // Expected state: Opened "Find Qualifier" dialog.
232 // 3. Enter to Name and Value fields 'protein' and 'NP_5', then click "Select All" button
233 // Expected state: Founded 2 qualifiers:
234 // protein_id - NP_597742.2
235 // protein_id - NP_597744.1
236
237 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
238 GTUtilsTaskTreeView::waitTaskFinished(os);
239 GTGlobals::sleep();
240
241 QTreeWidgetItem *featuresItem = GTUtilsAnnotationsTreeView::findItem(os, "NC_001363 features [murine.gb]");
242 CHECK_SET_ERR(featuresItem != nullptr, "\'NC_001363 features [murine.gb]\' item not found");
243
244 FindQualifierFiller::FindQualifierFillerSettings settings("protein",
245 "NP_5",
246 false,
247 false);
248 settings.selectAll = true;
249 GTUtilsDialog::waitForDialog(os, new FindQualifierFiller(os, settings));
250 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "find_qualifier_action"));
251 GTUtilsAnnotationsTreeView::callContextMenuOnItem(os, featuresItem);
252 GTThread::waitForMainThread();
253
254 QStringList qualValues;
255 QList<QTreeWidgetItem *> items = GTUtilsAnnotationsTreeView::getAllSelectedItems(os);
256 foreach (QTreeWidgetItem *i, items) {
257 AVItem *item = dynamic_cast<AVItem *>(i);
258 CHECK_SET_ERR(item != nullptr, "AvItem is NULL");
259 if (item->type == AVItemType_Qualifier) {
260 AVQualifierItem *avQualifierItem = (AVQualifierItem *)item;
261 qualValues << avQualifierItem->qValue;
262 }
263 }
264
265 CHECK_SET_ERR(qualValues.size() == 2, "Incorrect qualifiers count");
266 CHECK_SET_ERR(qualValues.contains("NP_597742.2"), "NP_597742.2 qualifier was not selected");
267 CHECK_SET_ERR(qualValues.contains("NP_597744.1"), "NP_597744.1 qualifier was not selected");
268 }
269
GUI_TEST_CLASS_DEFINITION(test_0057_5)270 GUI_TEST_CLASS_DEFINITION(test_0057_5) {
271 // Crash on a number of multisequence files opening in the merge mode
272 // 1. Open samples/Genbank/murine.gb.
273 // 2. Click on right mouse button on NC_001363 annotations tree view and select menu item "Find qualifier"
274 // Expected state: Opened "Find Qualifier" dialog.
275 // 3. Enter to Name and Value fields 'protein' and 'NP_5'. Also set checkbox to 'Exact match', then click "Next" button
276 // Expected state: Showed message box with information about reaults are not found.
277
278 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
279 GTUtilsTaskTreeView::waitTaskFinished(os);
280 GTGlobals::sleep();
281
282 QTreeWidgetItem *featuresItem = GTUtilsAnnotationsTreeView::findItem(os, "NC_001363 features [murine.gb]");
283 CHECK_SET_ERR(featuresItem != nullptr, "\'NC_001363 features [murine.gb]\' item not found");
284
285 FindQualifierFiller::FindQualifierFillerSettings settings("protein",
286 "NP_5",
287 true,
288 true,
289 1,
290 false,
291 true,
292 false);
293 GTUtilsDialog::waitForDialog(os, new FindQualifierFiller(os, settings));
294 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "find_qualifier_action"));
295 GTUtilsAnnotationsTreeView::callContextMenuOnItem(os, featuresItem);
296 GTGlobals::sleep();
297
298 QList<QTreeWidgetItem *> items = GTUtilsAnnotationsTreeView::getAllSelectedItems(os);
299 foreach (QTreeWidgetItem *i, items) {
300 AVItem *item = dynamic_cast<AVItem *>(i);
301 CHECK_SET_ERR(item != nullptr, "AvItem is NULL");
302 CHECK_SET_ERR(item->type == AVItemType_Group, "There are items selected");
303 }
304 }
305
GUI_TEST_CLASS_DEFINITION(test_0057_6)306 GUI_TEST_CLASS_DEFINITION(test_0057_6) {
307 // Crash on a number of multisequence files opening in the merge mode
308 // 1. Open samples/Genbank/murine.gb.
309 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
310 GTUtilsTaskTreeView::waitTaskFinished(os);
311
312 // 2. Click on right mouse button on NC_001363 annotations tree view and select menu item "Find qualifier"
313 // Expected state: Opened "Find Qualifier" dialog.
314 // 3. Enter to Name field 'source', Value field should be empty. Click "Next" button
315 // Expected state: a result is found.
316 // 4. Click "Next" button again.
317 // Expected state: Showed message box with information about the end of tree is reached.
318
319 QTreeWidgetItem *featuresItem = GTUtilsAnnotationsTreeView::findItem(os, "NC_001363 features [murine.gb]");
320 CHECK_SET_ERR(featuresItem != nullptr, "\'NC_001363 features [murine.gb]\' item not found");
321
322 FindQualifierFiller::FindQualifierFillerSettings settings("organism",
323 "",
324 true,
325 true,
326 2,
327 true,
328 false,
329 true);
330 GTUtilsDialog::waitForDialog(os, new FindQualifierFiller(os, settings));
331 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "find_qualifier_action"));
332 GTUtilsAnnotationsTreeView::callContextMenuOnItem(os, featuresItem);
333 GTGlobals::sleep();
334
335 QList<QTreeWidgetItem *> items = GTUtilsAnnotationsTreeView::getAllSelectedItems(os);
336 bool qualifierIsSelected = false;
337 foreach (QTreeWidgetItem *item, items) {
338 qualifierIsSelected |= (nullptr != dynamic_cast<AVQualifierItem *>(item));
339 }
340 CHECK_SET_ERR(qualifierIsSelected, "No qualifiers are selected");
341 }
342
GUI_TEST_CLASS_DEFINITION(test_0073_1)343 GUI_TEST_CLASS_DEFINITION(test_0073_1) {
344 /* 1) Open "Find substrings in sequences" WD sample
345 * 2) Click on "Find substrings" element
346 * Expected state: "Qualifier name for pattern name" element parameter presents
347 */
348 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
349
350 GTUtilsWorkflowDesigner::addSample(os, "Find substrings in sequences");
351 GTKeyboardDriver::keyClick(Qt::Key_Escape);
352
353 GTUtilsWorkflowDesigner::click(os, "Find Substrings");
354
355 QString patternName = GTUtilsWorkflowDesigner::getParameter(os, "Qualifier name for pattern name"); // pattern_name
356
357 CHECK_SET_ERR(patternName == QString("pattern_name"), "Parameter 'Qualifier name for pattern name' has wrong default value");
358 }
GUI_TEST_CLASS_DEFINITION(test_0073_2)359 GUI_TEST_CLASS_DEFINITION(test_0073_2) {
360 /* 1) Open "Find patterns" WD sample
361 * 2) Click on "Find Pattern" element
362 * Expected state: "Qualifier name for pattern name" element parameter presents
363 */
364 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
365
366 GTUtilsWorkflowDesigner::addSample(os, "Find patterns");
367 GTKeyboardDriver::keyClick(Qt::Key_Escape);
368
369 GTUtilsWorkflowDesigner::click(os, "Find Pattern");
370
371 QString patternName = GTUtilsWorkflowDesigner::getParameter(os, "Qualifier name for pattern name"); // pattern_name
372
373 CHECK_SET_ERR(patternName == QString("pattern_name"), "Parameter 'Qualifier name for pattern name' has wrong default value");
374 }
375
GUI_TEST_CLASS_DEFINITION(test_0339)376 GUI_TEST_CLASS_DEFINITION(test_0339) {
377 // UGENE-339, MacOs only
378
379 // 1. Open UGENE on MacOs
380 // 2. Open samples/FASTA/human_T1.fa
381 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
382 GTUtilsTaskTreeView::waitTaskFinished(os);
383
384 // 3. Press Ctrl+Shift+F
385 // hotkey replaced with Cmd+Shift+F on Mac
386 // Expected: Smith-Waterman dialog appears
387 // 4. Close the dialog
388 GTUtilsDialog::waitForDialog(os, new DefaultDialogFiller(os, "SmithWatermanDialogBase", QDialogButtonBox::Cancel));
389 GTKeyboardDriver::keyPress(Qt::Key_Control);
390 GTKeyboardDriver::keyClick('f', Qt::ShiftModifier);
391 GTKeyboardDriver::keyRelease(Qt::Key_Control);
392 GTGlobals::sleep();
393
394 // 5. Press Ctrl+N
395 // hotkey replaced with Cmd+N on Mac
396 // Expected: New annotation dialog appears
397 // 6. Close the dialog
398 GTUtilsDialog::waitForDialog(os, new DefaultDialogFiller(os, "CreateAnnotationDialog", QDialogButtonBox::Cancel));
399 GTKeyboardDriver::keyClick('n', Qt::ControlModifier);
400 GTGlobals::sleep();
401
402 // 7. Press Ctrl+F
403 // hotkey replaced with Cmd+F on Mac
404 // Expected: Search pattern panel appears
405 GTKeyboardDriver::keyClick('f', Qt::ControlModifier);
406 GTThread::waitForMainThread();
407 GTGlobals::sleep();
408 const bool isTabOpened = GTUtilsOptionPanelSequenceView::isTabOpened(os, GTUtilsOptionPanelSequenceView::Search);
409 CHECK_SET_ERR(isTabOpened, "'Search in sequence' tab is not opened");
410 }
411
GUI_TEST_CLASS_DEFINITION(test_0394)412 GUI_TEST_CLASS_DEFINITION(test_0394) {
413 // 1. Add to project sars.gb, murine.gb
414 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
415 GTUtilsTaskTreeView::waitTaskFinished(os);
416 // 2. Open sars.gb in sequence view.
417 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
418 GTUtilsTaskTreeView::waitTaskFinished(os);
419 // 3. Drag and drop murine.gb sequence NC_001363 to opened in previous step sequence view.
420 GTUtilsProjectTreeView::dragAndDrop(os, GTUtilsProjectTreeView::findIndex(os, "NC_001363"), GTUtilsMdi::activeWindow(os)->findChild<ADVSingleSequenceWidget *>());
421 // Expected state: Two sequnces showed in sequence view and NC_001363 is active.
422 int num = GTUtilsSequenceView::getSeqWidgetsNumber(os);
423 CHECK_SET_ERR(num == 2, QString("Unexpected sequence number: %1").arg(num));
424 // Order of seaqences is:
425 // 1) NC_004718 [dna]
426 QString first = GTUtilsSequenceView::getSeqName(os, 0);
427 CHECK_SET_ERR(first == "NC_004718", "Unexpected first sequence: " + first);
428 // 2) NC_001363 [dna]
429 QString second = GTUtilsSequenceView::getSeqName(os, 1);
430 CHECK_SET_ERR(second == "NC_001363", "Unexpected second sequence: " + second);
431 // TODO: good drag and drop needed
432 // 4. Drag sequence NC_001363 to up and drop.
433 // 1) NC_001363 [dna]
434 // 2) NC_004718 [dna]
435 }
436
GUI_TEST_CLASS_DEFINITION(test_0407)437 GUI_TEST_CLASS_DEFINITION(test_0407) {
438 // 1. Open _common_data/scenarios/_regression/407/trail.fas
439 // Expected state: a message box appears
440 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
441 GTUtilsProject::openFile(os, testDir + "_common_data/scenarios/_regression/407/trail.fas");
442 }
443
GUI_TEST_CLASS_DEFINITION(test_0490)444 GUI_TEST_CLASS_DEFINITION(test_0490) {
445 // 1. Select "Tools > Multiple alignment > [any item]"
446 // 2. In the dialog appeared select _common_data/scenarios/_regression/490/fasta-example.fa
447 // 3. Click "Align"
448 // Expected stat: UGENE not crashes
449
450 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/490/fasta-example.fa");
451 GTUtilsTaskTreeView::waitTaskFinished(os);
452 GTUtilsDialog::waitForDialog(os, new KalignDialogFiller(os));
453
454 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "align_with_kalign"));
455 GTWidget::click(os, GTUtilsMdi::activeWindow(os), Qt::RightButton);
456 GTGlobals::sleep();
457 GTGlobals::sleep();
458 }
459
GUI_TEST_CLASS_DEFINITION(test_0567)460 GUI_TEST_CLASS_DEFINITION(test_0567) {
461 // 1. Open samples/human_T1.fa
462 // 2. Press button "build dotplot" on toolbar.
463 // Expected: "Build dotplot" dialog is opened.
464 // 3. Press button "Load sequence".
465 // 4. Open File _common_data/scenarios/dp_view/dpm1.fa
466 // 5. Press button "Load sequence"
467 // 6. Open File _common_data/scenarios/dp_view/dpm2.fa
468 // Expected: UGENE does not crash.
469
470 class Test_0567 : public Filler {
471 public:
472 Test_0567(HI::GUITestOpStatus &os)
473 : Filler(os, "DotPlotDialog") {
474 }
475 virtual void run() {
476 QWidget *dialog = GTWidget::getActiveModalWidget(os);
477 CHECK_SET_ERR(dialog, "activeModalWidget is NULL");
478
479 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os));
480 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/scenarios/dp_view/dpm1.fa"));
481 GTWidget::click(os, dialog->findChild<QPushButton *>("loadSequenceButton"));
482 GTGlobals::sleep();
483
484 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os));
485 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/scenarios/dp_view/dpm2.fa"));
486 GTWidget::click(os, dialog->findChild<QPushButton *>("loadSequenceButton"));
487 GTGlobals::sleep();
488
489 QDialogButtonBox *box = qobject_cast<QDialogButtonBox *>(GTWidget::findWidget(os, "buttonBox", dialog));
490 QPushButton *button = box->button(QDialogButtonBox::Cancel);
491 CHECK_SET_ERR(button != nullptr, "cancel button is NULL");
492 GTWidget::click(os, button);
493 }
494 };
495
496 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
497 GTUtilsTaskTreeView::waitTaskFinished(os);
498 GTGlobals::sleep();
499
500 GTUtilsDialog::waitForDialog(os, new Test_0567(os));
501 GTWidget::click(os, GTWidget::findWidget(os, "build_dotplot_action_widget"));
502 GTGlobals::sleep(1000);
503 }
504
GUI_TEST_CLASS_DEFINITION(test_0574)505 GUI_TEST_CLASS_DEFINITION(test_0574) {
506 // 1. Open murine.gb
507 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
508 GTUtilsTaskTreeView::waitTaskFinished(os);
509
510 // 2. Select in menu Actions->Cloning->Create fragment...
511 // 3. Set any region, don`t include overhangs, click OK
512 GTUtilsDialog::waitForDialog(os, new CreateFragmentDialogFiller(os));
513 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Cloning"
514 << "Create Fragment"));
515 GTUtilsSequenceView::openPopupMenuOnSequenceViewArea(os);
516 GTUtilsTaskTreeView::waitTaskFinished(os);
517
518 // 4. Select newly created fragment
519 GTUtilsAnnotationsTreeView::selectItems(os, QStringList() << "Fragment (1-5833)");
520
521 // 5. Select in menu Actions->Cloning->Construct molecule...
522 class Scenario : public CustomScenario {
523 public:
524 void run(HI::GUITestOpStatus &os) {
525 // 6. In dialog select your fragment in "Available fragments", click Add
526 GTWidget::click(os, GTWidget::findWidget(os, "takeAllButton"));
527
528 // 7. Select your fragment in "New molecule contents", click Edit
529 QTreeWidget *tree = dynamic_cast<QTreeWidget *>(GTWidget::findWidget(os, "molConstructWidget"));
530 GTTreeWidget::click(os, GTTreeWidget::findItem(os, tree, "Blunt"));
531
532 // 8. For the left end: select Overhang, check Custom Overhang, select 5'-3', write "AA" (without the quotes) to the 5'-3' edit
533 // 9. For the right end: select Overhang, check Custom Overhang, select 3'-5', write "CC" (without the quotes) to the 3'-5' edit
534 EditFragmentDialogFiller::Parameters p;
535 p.lSticky = true;
536 p.lCustom = true;
537 p.lDirect = true;
538 p.lDirectText = "AA";
539 p.rSticky = true;
540 p.rCustom = true;
541 p.rDirect = false;
542 p.rComplText = "CC";
543 GTUtilsDialog::waitForDialog(os, new EditFragmentDialogFiller(os, p));
544 GTWidget::click(os, GTWidget::findWidget(os, "editFragmentButton"));
545
546 // 10. Click OK, open edit dialog for this fragment again.
547 // Expected state: 3'-5' edit for the right end contains "CC" (bug: it contains "GG")
548 p.checkRComplText = true;
549 GTUtilsDialog::waitForDialog(os, new EditFragmentDialogFiller(os, p));
550 GTTreeWidget::click(os, GTTreeWidget::findItem(os, tree, "AA (Fwd)"));
551 GTWidget::click(os, GTWidget::findWidget(os, "editFragmentButton"));
552
553 GTUtilsDialog::clickButtonBox(os, QApplication::activeModalWidget(), QDialogButtonBox::Cancel);
554 }
555 };
556 GTUtilsDialog::waitForDialog(os, new ConstructMoleculeDialogFiller(os, new Scenario()));
557 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
558 << "Cloning"
559 << "Construct molecule...");
560 }
561
GUI_TEST_CLASS_DEFINITION(test_0587)562 GUI_TEST_CLASS_DEFINITION(test_0587) {
563 class CheckBowtie2Filler : public Filler {
564 public:
565 CheckBowtie2Filler(HI::GUITestOpStatus &os)
566 : Filler(os, "BuildIndexFromRefDialog") {
567 }
568 virtual void run() {
569 QWidget *dialog = GTWidget::getActiveModalWidget(os);
570 CHECK_SET_ERR(dialog, "activeModalWidget is NULL");
571
572 QComboBox *methodNamesBox = dialog->findChild<QComboBox *>("methodNamesBox");
573 for (int i = 0; i < methodNamesBox->count(); i++) {
574 if (methodNamesBox->itemText(i) == "UGENE Genome Aligner") {
575 GTComboBox::selectItemByIndex(os, methodNamesBox, i);
576 }
577 }
578
579 GTFileDialogUtils *ob = new GTFileDialogUtils(os, testDir + "_common_data/genbank/", "NC_014267.1_cut.gb");
580 GTUtilsDialog::waitForDialog(os, ob);
581 GTWidget::click(os, GTWidget::findWidget(os, "addRefButton", dialog));
582
583 GTGlobals::sleep();
584 ob = new GTFileDialogUtils(os, sandBoxDir, "587_NC_014267.1_cut", GTFileDialogUtils::Save);
585 GTUtilsDialog::waitForDialog(os, ob);
586 GTWidget::click(os, GTWidget::findWidget(os, "setIndexFileNameButton", dialog));
587
588 QDialogButtonBox *box = qobject_cast<QDialogButtonBox *>(GTWidget::findWidget(os, "buttonBox", dialog));
589 CHECK_SET_ERR(box != nullptr, "buttonBox is NULL");
590
591 QPushButton *okButton = box->button(QDialogButtonBox::Ok);
592 CHECK_SET_ERR(okButton != nullptr, "ok button is NULL");
593 GTWidget::click(os, okButton);
594 }
595 };
596
597 GTLogTracer lt;
598 GTUtilsDialog::waitForDialog(os, new CheckBowtie2Filler(os));
599 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
600 << "NGS data analysis"
601 << "Build index for reads mapping...");
602 CHECK_SET_ERR(!lt.hasErrors(), "Errors in log: " + lt.getJoinedErrorString());
603 }
604
GUI_TEST_CLASS_DEFINITION(test_0597)605 GUI_TEST_CLASS_DEFINITION(test_0597) {
606 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
607 GTUtilsTaskTreeView::waitTaskFinished(os);
608
609 // Open graph.
610 QWidget *sequenceWidget = GTWidget::findWidget(os, "ADV_single_sequence_widget_0");
611 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, {"Karlin Signature Difference"}));
612 GTWidget::click(os, GTWidget::findWidget(os, "GraphMenuAction", sequenceWidget));
613 GTUtilsTaskTreeView::waitTaskFinished(os);
614
615 // Save cutoffs as annotations and check the expected result.
616 class SaveGraphCutoffsDialogFiller : public Filler {
617 public:
618 SaveGraphCutoffsDialogFiller(HI::GUITestOpStatus &os)
619 : Filler(os, "SaveGraphCutoffsDialog") {
620 }
621 void commonScenario() override {
622 QWidget *dialog = GTWidget::getActiveModalWidget(os);
623
624 QLineEdit *newTablePath = GTWidget::findLineEdit(os, "leNewTablePath", dialog);
625 GTLineEdit::setText(os, newTablePath, sandBoxDir + "test_0597");
626
627 QDialogButtonBox *box = GTWidget::findExactWidget<QDialogButtonBox *>(os, "buttonBox", dialog);
628 QPushButton *okButton = box->button(QDialogButtonBox::Ok);
629 CHECK_SET_ERR(okButton != nullptr, "OK button is NULL");
630 GTWidget::click(os, okButton);
631 }
632 };
633
634 GTUtilsDialog::waitForDialog(os, new SaveGraphCutoffsDialogFiller(os));
635 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, {"Graph", "save_cutoffs_as_annotation"}));
636 GTMenu::showContextMenu(os, GTWidget::findWidget(os, "GSequenceGraphViewRenderArea"));
637 GTUtilsTaskTreeView::waitTaskFinished(os);
638 GTUtilsAnnotationsTreeView::findItem(os, "graph_cutoffs (0, 4)");
639 }
640
GUI_TEST_CLASS_DEFINITION(test_0598)641 GUI_TEST_CLASS_DEFINITION(test_0598) {
642 // 1. Open file '_common_data/fasta/Mycobacterium.fna'
643 GTFileDialog::openFile(os, testDir + "_common_data/fasta", "Mycobacterium.fna");
644 GTUtilsTaskTreeView::waitTaskFinished(os);
645
646 QWidget *sequenceWidget = GTWidget::findWidget(os, "ADV_single_sequence_widget_0");
647
648 // 2. Show DNA Flexibility graph
649 // Expected state: 'Calculate graph points' task is started
650 QWidget *graphAction = GTWidget::findWidget(os, "GraphMenuAction", sequenceWidget);
651 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, {"DNA Flexibility"}));
652 GTWidget::click(os, graphAction);
653 GTUtilsTask::waitTaskStart(os, "Calculate graph points", 30000);
654 GTUtilsTaskTreeView::waitTaskFinished(os);
655
656 // 3. Zoom graph
657 // Expected state: cached data is used and 'Calculate graph points' task is not started
658 GTWidget::click(os, GTAction::button(os, "action_zoom_in_gi|119866057|ref|NC_008705.1| Mycobacterium sp. KMS, complete genome"));
659 GTGlobals::sleep(500);
660 CHECK_SET_ERR(GTUtilsTaskTreeView::getTopLevelTasksCount(os) == 0, "'Calculate graph points' task is started, but cached data should be used");
661
662 // 4. Use context menu {Graph -> Graph settings...}
663 // Expected state: 'Graph Settings' dialog is appeared
664 // 5. Set parameters: window = 1000, step = 4
665 // 6. Press 'Ok'
666 // Expected state: 'Calculate graph points' task is started.
667 GTUtilsDialog::waitForDialog(os, new GraphSettingsDialogFiller(os, 200, 100));
668 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, {"Graph", "visual_properties_action"}));
669 QWidget *graphView = GTUtilsSequenceView::getGraphView(os);
670 GTWidget::click(os, graphView, Qt::RightButton);
671 GTUtilsTaskTreeView::checkTask(os, "Calculate graph points");
672 }
673
GUI_TEST_CLASS_DEFINITION(test_0605)674 GUI_TEST_CLASS_DEFINITION(test_0605) {
675 // Crash on a number of multisequence files opening in the merge mode
676
677 // 1. Open _common_data/scenarios/dp_view/EF591300.gb.
678 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/dp_view/EF591300.gb");
679 GTUtilsTaskTreeView::waitTaskFinished(os);
680
681 // 2. Open _common_data/scenarios/dp_view/dpm1.fa.
682 // 3. Choose the "Merge sequences into single sequence to show in sequence viewer" option with any gap size in the "Sequence reading option" dialog.
683 GTUtilsProject::openMultiSequenceFileAsMergedSequence(os, testDir + "_common_data/scenarios/dp_view/dpm1.fa");
684
685 // 4. Open _common_data/scenarios/dp_view/dpm2.fa.
686 // 5. Choose the same option.
687 GTUtilsProject::openMultiSequenceFileAsMergedSequence(os, testDir + "_common_data/scenarios/dp_view/dpm2.fa");
688 }
689
GUI_TEST_CLASS_DEFINITION(test_0610)690 GUI_TEST_CLASS_DEFINITION(test_0610) {
691 GTLogTracer logTracer;
692
693 // 1. Open any MSA, i.e. samples/ClustalW/COI.aln
694 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/COI.aln");
695 GTUtilsTaskTreeView::waitTaskFinished(os);
696
697 // 2. Click on any letter (it will be selected with dash rectangle)
698 GTUtilsMSAEditorSequenceArea::clickToPosition(os, QPoint(1, 1));
699
700 // 3. Click on white area below sequences (there will be no selection)
701 // this step is depreceated: it will cause selecting a symbol in the last row.
702 GTUtilsMSAEditorSequenceArea::cancelSelection(os);
703
704 // 4. Modify MSA: aligh with any algorithm
705 // Expected state: UGENE not crased
706 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "align_with_kalign", GTGlobals::UseMouse));
707 GTUtilsDialog::waitForDialog(os, new KalignDialogFiller(os));
708 GTUtilsMSAEditorSequenceArea::callContextMenu(os);
709
710 GTUtilsTaskTreeView::waitTaskFinished(os);
711
712 GTUtilsLog::check(os, logTracer);
713 }
714
GUI_TEST_CLASS_DEFINITION(test_0627)715 GUI_TEST_CLASS_DEFINITION(test_0627) {
716 // 1. Open _common_data/fasta/fa1.fa.
717 // Expected state: the file opens in the sequence viewer.
718 // 2. Click the {Primer3} button on the toolbar.
719 // Expected state: Primer designer dialog appeares.
720 // 3. Check all fields except the list below for tooltips presence.
721 // List of exceptions:
722 // Region defenition on all tags;
723 // "Reset Form" and "Pick Primers" buttons on all tags;
724 // Main tag (tag has not tooltip):
725 // Pick left primer checkbox
726 // left primer lineedit below checkbox
727 // Pick hybridization probe checkbox
728 // olygo lineedit below checkbox
729 // Pick right primer checkbox
730 // right primer lineedit below checkbox
731 // General settings tag:
732 // Liberal base checkbox
733 // Show debug info checkbox
734 // Do not treat ambiguity codes in libraries as consensus checkbox
735 // Lowercase masking checkbox
736 // Internal Oligo tag: nothing
737 // Penalty Weights: nothing
738 // Span Intron/Exon: nothing
739 // Sequence quality: nothing
740 // Resul Settings: all fields and buttons
741 // Expected state: tooltips are presented.
742
743 class ToolTipsChecker : public Filler {
744 public:
745 ToolTipsChecker(HI::GUITestOpStatus &os)
746 : Filler(os, "Primer3Dialog") {
747 }
748 virtual void run() {
749 QDialog *dialog = qobject_cast<QDialog *>(QApplication::activeModalWidget());
750 CHECK_SET_ERR(dialog != nullptr, "dialog not found");
751 GTGlobals::sleep();
752
753 QList<QObject *> children = findAllChildren(dialog);
754
755 QList<QString> objsWithoutTooltips;
756 foreach (QObject *obj, children) {
757 bool lineEditSpinBoxOrComboBox = qobject_cast<QLineEdit *>(obj) != nullptr ||
758 qobject_cast<QSpinBox *>(obj) != nullptr ||
759 qobject_cast<QComboBox *>(obj) != nullptr;
760 bool widgetWithoutToolTip = qobject_cast<QWidget *>(obj) != nullptr &&
761 qobject_cast<QWidget *>(obj)->toolTip().isEmpty();
762 if (lineEditSpinBoxOrComboBox && widgetWithoutToolTip && obj->objectName() != "qt_spinbox_lineedit") {
763 objsWithoutTooltips << obj->objectName();
764 }
765 }
766
767 QList<QString> exceptions;
768 exceptions << "start_edit_line"
769 << "end_edit_line"
770 << "region_type_combo"
771 << "edit_PRIMER_LEFT_INPUT"
772 << "edit_PRIMER_RIGHT_INPUT"
773 << "edit_PRIMER_INTERNAL_OLIGO_INPUT"
774 << "cbExistingTable"
775 << "cbAnnotationType"
776 << "leNewTablePath"
777 << "leDescription"
778 << "leftOverlapSizeSpinBox"
779 << "rightOverlapSizeSpinBox"
780 << "leGroupName"
781 << "leAnnotationName";
782
783 foreach (const QString &name, objsWithoutTooltips) {
784 CHECK_SET_ERR(exceptions.contains(name), QString("The following field has no tool tip: %1").arg(name));
785 }
786
787 GTWidget::close(os, dialog);
788 }
789
790 private:
791 QList<QObject *> findAllChildren(QObject *obj) {
792 QList<QObject *> children;
793 foreach (QObject *o, obj->children()) {
794 children << o;
795 children << findAllChildren(o);
796 }
797 return children;
798 }
799 };
800
801 GTFileDialog::openFile(os, testDir + "_common_data/fasta/fa1.fa");
802 GTUtilsTaskTreeView::waitTaskFinished(os);
803
804 QAbstractButton *primer3 = GTAction::button(os, "primer3_action");
805 CHECK_SET_ERR(primer3 != nullptr, "primer3_action not found");
806
807 GTUtilsDialog::waitForDialog(os, new ToolTipsChecker(os));
808 GTWidget::click(os, primer3);
809 GTGlobals::sleep();
810 }
811
GUI_TEST_CLASS_DEFINITION(test_0652)812 GUI_TEST_CLASS_DEFINITION(test_0652) {
813 // 1) Open /data/samples/fasta/human_T1.fa
814 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
815 GTUtilsSequenceView::checkSequenceViewWindowIsActive(os);
816
817 // 2) Open /data/samples/gff/5prime_utr_intron_A20.gff
818 GTFileDialog::openFile(os, dataDir + "samples/GFF/5prime_utr_intron_A20.gff");
819 GTUtilsTaskTreeView::waitTaskFinished(os);
820
821 // 3) Drag and drop first annotation from gff file to sequence view of human_T1
822 // 4) On question "Found annotations that are out of sequence range, continue?" answer "Yes"
823 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Yes));
824 GTUtilsAnnotationsTreeView::addAnnotationsTableFromProject(os, "Ca20Chr1 features");
825
826 // 5) In annotations tree view open added annotation and put the mouse cursor over this annotation.
827 GTUtilsAnnotationsTreeView::findItem(os, "5_prime_UTR_intron");
828 }
829
GUI_TEST_CLASS_DEFINITION(test_0659)830 GUI_TEST_CLASS_DEFINITION(test_0659) {
831 // Write annotations worker is broken
832 // 1. Open WD. Create simple scheme "read sequence"->"Write annotations"
833 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
834 // 2. Set "GenBank" as output document format for "Write annotations" worker.
835 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
836 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Annotations", true);
837 GTUtilsWorkflowDesigner::connect(os, read, write);
838
839 // 3. Set up valid output input files for scheme, and run it (for example set input file samples/GENBANK/sars.gb)
840 GTUtilsWorkflowDesigner::click(os, read);
841 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Genbank/sars.gb");
842 GTUtilsWorkflowDesigner::click(os, write);
843 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir(sandBoxDir).absolutePath() + "/test_659", GTUtilsWorkflowDesigner::textValue);
844 GTUtilsWorkflowDesigner::setParameter(os, "Document format", "GenBank", GTUtilsWorkflowDesigner::comboValue);
845 GTUtilsWorkflowDesigner::runWorkflow(os);
846 GTUtilsTaskTreeView::waitTaskFinished(os);
847 // Expected state: annotations has been written in single file
848 QDir d(QDir(sandBoxDir).absolutePath());
849 QStringList list = d.entryList(QStringList() << "test_659*");
850 CHECK_SET_ERR(list.count() == 1, QString("unexpected files number: %1").arg(list.count()));
851 CHECK_SET_ERR(list.first() == "test_659", "unexpected file name: " + list.first());
852
853 GTWidget::click(os, GTAction::button(os, "toggleDashboard"));
854 // check csv format
855 GTUtilsWorkflowDesigner::click(os, write);
856 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir(sandBoxDir).absolutePath() + "/test_659_1", GTUtilsWorkflowDesigner::textValue);
857 GTUtilsWorkflowDesigner::setParameter(os, "Document format", "CSV", GTUtilsWorkflowDesigner::comboValue);
858 GTUtilsWorkflowDesigner::runWorkflow(os);
859 GTUtilsTaskTreeView::waitTaskFinished(os);
860 // Expected state: annotations has been written in single file
861 list = d.entryList(QStringList() << "test_659*");
862 CHECK_SET_ERR(list.count() == 2, QString("unexpected files number: %1").arg(list.count()));
863 CHECK_SET_ERR(list.contains("test_659_1"), "unexpected file name csv: " + list[1]);
864
865 GTWidget::click(os, GTAction::button(os, "toggleDashboard"));
866 // check gff format
867 GTUtilsWorkflowDesigner::click(os, write);
868 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir(sandBoxDir).absolutePath() + "/test_659_2", GTUtilsWorkflowDesigner::textValue);
869 GTUtilsWorkflowDesigner::setParameter(os, "Document format", "GFF", GTUtilsWorkflowDesigner::comboValue);
870 GTUtilsWorkflowDesigner::runWorkflow(os);
871 GTUtilsTaskTreeView::waitTaskFinished(os);
872 // Expected state: annotations has been written in single file
873 list = d.entryList(QStringList() << "test_659*");
874 CHECK_SET_ERR(list.count() == 3, QString("unexpected files number: %1").arg(list.count()));
875 CHECK_SET_ERR(list.contains("test_659_2"), "unexpected file name csv: " + list[2]);
876 }
877
GUI_TEST_CLASS_DEFINITION(test_0666)878 GUI_TEST_CLASS_DEFINITION(test_0666) {
879 /* Crash on removing some annotations from Primer3 result
880 * 1. Open samples\FASTA\human_T1.fa
881 * 2. Search about 50 primers
882 * 3. Try delete 10 or more results annotations
883 * Expected state: UGENE not crashes
884 */
885 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
886 GTUtilsSequenceView::checkSequenceViewWindowIsActive(os);
887
888 GTFileDialog::openFile(os, testDir + "_common_data/regression/666/", "regression_0666.gb");
889 GTUtilsTaskTreeView::waitTaskFinished(os);
890 QModelIndex projectTreeItem = GTUtilsProjectTreeView::findIndex(os, "Annotations");
891
892 GTUtilsDialog::waitForDialog(os, new CreateObjectRelationDialogFiller(os));
893 GTUtilsProjectTreeView::dragAndDrop(os, projectTreeItem, GTUtilsSequenceView::getPanOrDetView(os));
894 GTUtilsDialog::waitAllFinished(os);
895
896 GTUtilsAnnotationsTreeView::selectItems(os, QStringList() << "pair 1 (0, 2)"
897 << "pair 10 (0, 2)"
898 << "pair 11 (0, 2)"
899 << "pair 12 (0, 2)"
900 << "pair 13 (0, 2)"
901 << "pair 14 (0, 2)"
902 << "pair 15 (0, 2)"
903 << "pair 16 (0, 2)"
904 << "pair 17 (0, 2)"
905 << "pair 18 (0, 2)"
906 << "pair 19 (0, 2)");
907 GTKeyboardDriver::keyClick(Qt::Key_Delete);
908 }
909
GUI_TEST_CLASS_DEFINITION(test_0677)910 GUI_TEST_CLASS_DEFINITION(test_0677) {
911 // 1. Open the file bamExample.bam.
912 // 2. Check the box 'Import unmapped reads' and import the file.
913 // Expected state: UGENE not crashed
914
915 GTLogTracer l;
916 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "test_0677/test_0677.ugenedb", "", "", true));
917 GTFileDialog::openFile(os, testDir + "_common_data/bam/", "1.bam");
918 GTUtilsTaskTreeView::waitTaskFinished(os);
919 GTUtilsLog::check(os, l);
920 }
GUI_TEST_CLASS_DEFINITION(test_0678)921 GUI_TEST_CLASS_DEFINITION(test_0678) {
922 // 1. Open samples/PDB/1CF7.pdb
923 // 2. Navigate in annotation tree, unfolding following items: {1CF7 chain 1 annotation <97> chain_info (0, 1) <97> chain_info}
924 // Expected state: UGENE not crashes
925
926 GTFileDialog::openFile(os, dataDir + "samples/PDB/1CF7.PDB");
927 GTUtilsTaskTreeView::waitTaskFinished(os);
928 GTUtilsAnnotationsTreeView::selectItems(os, QStringList() << "chain_info");
929 }
930
GUI_TEST_CLASS_DEFINITION(test_0680)931 GUI_TEST_CLASS_DEFINITION(test_0680) {
932 // 1. Open /data/sample/PDB/1CRN.pdb
933 // Expected state: Sequence is opened
934 // 2. Do context menu "Analyze - Predict Secondary Structure"
935 // Expected state: Predict Secondary Structure dialog is appeared
936 // 3. Set "Range Start" 1, "Range End": 2, set any prediction algorithm
937 // 4. Press "Start prediction" button
938 // UGENE not crashes
939 GTFileDialog::openFile(os, dataDir + "samples/PDB", "1CF7.PDB");
940 GTUtilsTaskTreeView::waitTaskFinished(os);
941 GTUtilsDialog::waitForDialog(os, new PredictSecondaryStructureDialogFiller(os, 1, 2, true));
942 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_ANALYSE << "Predict secondary structure"));
943 GTWidget::click(os, GTWidget::findWidget(os, "ADV_single_sequence_widget_0"), Qt::RightButton);
944 GTGlobals::sleep();
945 }
946
GUI_TEST_CLASS_DEFINITION(test_0681)947 GUI_TEST_CLASS_DEFINITION(test_0681) {
948 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/681", "seq.fa");
949 GTUtilsTaskTreeView::waitTaskFinished(os);
950
951 GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os, 1, 9));
952 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Select"
953 << "Sequence region"));
954 GTWidget::click(os, GTUtilsSequenceView::getSeqWidgetByNumber(os)->getDetView(), Qt::RightButton);
955
956 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_COPY << ADV_COPY_TRANSLATION_ACTION, GTGlobals::UseKey));
957 GTWidget::click(os, GTUtilsSequenceView::getSeqWidgetByNumber(os)->getDetView(), Qt::RightButton);
958 GTGlobals::sleep(1000);
959 QString text = GTClipboard::text(os);
960
961 CHECK_SET_ERR(text == "TRC", "Sequcence part translated to <" + text + ">, expected TRC");
962 }
963
GUI_TEST_CLASS_DEFINITION(test_0684)964 GUI_TEST_CLASS_DEFINITION(test_0684) {
965 // 1. Open samples/Genbank/sars
966 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
967 GTUtilsTaskTreeView::waitTaskFinished(os);
968
969 // 2. Select region 2000-9000
970 GTUtilsSequenceView::selectSequenceRegion(os, 2000, 9000);
971
972 // 3. Activate "Clonning->Create fragment"
973
974 class CreateFragmentScenario : public CustomScenario {
975 public:
976 void run(HI::GUITestOpStatus &os) {
977 QWidget *dialog = GTWidget::getActiveModalWidget(os);
978 // The opened dialog should have the selected region by default.
979 GTComboBox::checkCurrentValue(os, GTWidget::findExactWidget<QComboBox *>(os, "region_type_combo", dialog), "Selected region");
980 GTLineEdit::checkText(os, GTWidget::findExactWidget<QLineEdit *>(os, "start_edit_line", dialog), "2000");
981 GTLineEdit::checkText(os, GTWidget::findExactWidget<QLineEdit *>(os, "end_edit_line", dialog), "9000");
982
983 // 4. Set left overhang "AATT", forward
984 GTGroupBox::setChecked(os, "leftEndBox", dialog);
985 GTRadioButton::click(os, GTWidget::findExactWidget<QRadioButton *>(os, "lDirectButton", dialog));
986 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "lCustomOverhangEdit", dialog), "AATT");
987
988 // Set right overhang "AATT", reverse-complement
989 GTGroupBox::setChecked(os, "rightEndBox", dialog);
990 GTRadioButton::click(os, GTWidget::findExactWidget<QRadioButton *>(os, "rComplButton", dialog));
991 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "rCustomOverhangEdit", dialog), "AATT");
992
993 // Click OK
994 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
995 }
996 };
997
998 GTUtilsDialog::waitForDialog(os, new CreateFragmentDialogFiller(os, new CreateFragmentScenario));
999 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
1000 << "Cloning"
1001 << "Create fragment...");
1002
1003 // 5. Activate "Cloning->Construct molecule"
1004
1005 class ConstructMoleculeScenario : public CustomScenario {
1006 public:
1007 void run(HI::GUITestOpStatus &os) {
1008 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1009 // Add created fragment.
1010 GTListWidget::click(os, GTWidget::findExactWidget<QListWidget *>(os, "fragmentListWidget", dialog), "NC_004718 (sars.gb) Fragment (2000-9000) [core length - 7001 bp]");
1011 GTWidget::click(os, GTWidget::findWidget(os, "takeButton", dialog));
1012
1013 // Set "Make circular" option selected
1014 GTCheckBox::setChecked(os, GTWidget::findExactWidget<QCheckBox *>(os, "makeCircularBox", dialog));
1015
1016 // The overhangs should be highlighted in green
1017 QTreeWidgetItem *item = GTTreeWidget::findItem(os, GTWidget::findExactWidget<QTreeWidget *>(os, "molConstructWidget", dialog), "NC_004718 (sars.gb) Fragment (2000-9000) [core length - 7001 bp]", nullptr, 1);
1018 CHECK_SET_ERR(nullptr != item, "Item is NULL");
1019
1020 const QColor color1 = item->textColor(0);
1021 const QColor color2 = item->textColor(2);
1022 const QColor expectedColor = Qt::green;
1023
1024 CHECK_SET_ERR(expectedColor == color1, QString("An unexpected item text color in column 0: expect '%1', got '%2'").arg(expectedColor.name()).arg(color1.name()));
1025 CHECK_SET_ERR(expectedColor == color2, QString("An unexpected item text color in column 2: expect '%1', got '%2'").arg(expectedColor.name()).arg(color2.name()));
1026
1027 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
1028 }
1029 };
1030
1031 GTUtilsDialog::waitForDialog(os, new ConstructMoleculeDialogFiller(os, new ConstructMoleculeScenario));
1032 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
1033 << "Cloning"
1034 << "Construct molecule...");
1035 }
1036
GUI_TEST_CLASS_DEFINITION(test_0685)1037 GUI_TEST_CLASS_DEFINITION(test_0685) {
1038 // 1. Do menu tools->Blast+ Search (ext. tools must be configured)
1039 // 2. Set next parameters:
1040 // {Select input file} _common_data\scenarios\external_tools\blast\SequenceLength_00003000.txt
1041 // {Select search} blastp
1042 // Expected state: UGENE not crashes
1043 BlastAllSupportDialogFiller::Parameters blastParams;
1044 blastParams.runBlast = true;
1045 blastParams.programNameText = "blastp";
1046 blastParams.withInputFile = true;
1047 blastParams.inputPath = testDir + "_common_data/scenarios/external_tools/blast/SequenceLength_00003000.txt";
1048 blastParams.dbPath = testDir + "_common_data/cmdline/external-tool-support/blastplus/human_T1/human_T1.nhr";
1049 GTUtilsDialog::waitForDialog(os, new BlastAllSupportDialogFiller(blastParams, os));
1050 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
1051 << "BLAST"
1052 << "BLAST+ search...");
1053 GTGlobals::sleep();
1054 GTGlobals::sleep();
1055 GTUtilsTaskTreeView::waitTaskFinished(os);
1056 }
1057
GUI_TEST_CLASS_DEFINITION(test_0688)1058 GUI_TEST_CLASS_DEFINITION(test_0688) {
1059 // 1. Open any sequence
1060 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
1061 GTUtilsTaskTreeView::waitTaskFinished(os);
1062
1063 // 2. do context menu {Analyzq->Search TBFS with matrices}
1064
1065 class Scenario : public CustomScenario {
1066 public:
1067 void run(HI::GUITestOpStatus &os) {
1068 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1069 // 3. In opened dialog, select any matrix and press Search button
1070 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, dataDir + "position_weight_matrix/JASPAR/fungi/MA0265.1.pfm"));
1071 GTWidget::click(os, GTWidget::findWidget(os, "pbSelectModelFile", dialog));
1072
1073 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
1074 GTUtilsTaskTreeView::waitTaskFinished(os);
1075
1076 // Expected state: selected matrix still shown
1077 const QString expectedPath = QFileInfo(dataDir + "position_weight_matrix/JASPAR/fungi/MA0265.1.pfm").canonicalFilePath();
1078 GTLineEdit::checkText(os, GTWidget::findExactWidget<QLineEdit *>(os, "modelFileEdit", dialog), expectedPath);
1079
1080 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
1081 }
1082 };
1083
1084 GTUtilsDialog::waitForDialog(os, new PwmSearchDialogFiller(os, new Scenario));
1085 GTToolbar::clickButtonByTooltipOnToolbar(os, MWTOOLBAR_ACTIVEMDI, "Find TFBS with matrices");
1086 }
1087
GUI_TEST_CLASS_DEFINITION(test_0700)1088 GUI_TEST_CLASS_DEFINITION(test_0700) {
1089 /* Selecting "Cancel" in the "Import BAM file" dialog causes an error (UGENE-700)
1090 * 1. Open a _common_data/scenarios/assembly/example-alignment.bam
1091 * 2. Click "Cancel".
1092 * Expected state: UGENE not crashed
1093 */
1094 class CancelScenario : public CustomScenario {
1095 public:
1096 void run(HI::GUITestOpStatus &os) {
1097 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1098 GTGlobals::sleep(500);
1099 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
1100 }
1101 };
1102 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, new CancelScenario()));
1103 GTUtilsProject::openFile(os, testDir + "_common_data/scenarios/assembly/example-alignment.bam");
1104 }
1105
GUI_TEST_CLASS_DEFINITION(test_0702)1106 GUI_TEST_CLASS_DEFINITION(test_0702) {
1107 // 1. open _common_data / fasta / DNA.fa in merge mode.
1108 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Merge));
1109 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/DNA.fa");
1110 GTUtilsTaskTreeView::waitTaskFinished(os);
1111
1112 // 2. Select first contig(1..743) region.
1113 GTUtilsAnnotationsTreeView::selectItems(os, QStringList() << "contig");
1114
1115 // 3. Do context menu{ Export->export sequence of selected annotations).
1116 // 4. Fill next fields in appeared dialog, and execute it :
1117 //{export to file} -D : / test / _common_data / fasta / DNA_annotation.fastq
1118 //{ file format to use } -FASTQ
1119 //{ Save document to the project } -checked
1120 //{ Save as separare sequences } -checked.
1121 // Expected state : UGENE not crashed
1122 GTUtilsDialog::waitForDialog(os, new ExportSequenceOfSelectedAnnotationsFiller(os, sandBoxDir + "1.fa", ExportSequenceOfSelectedAnnotationsFiller::Fastq, ExportSequenceOfSelectedAnnotationsFiller::SaveAsSeparate));
1123 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Export"
1124 << "Export sequence of selected annotations..."));
1125 GTMouseDriver::click(Qt::RightButton);
1126 }
1127
GUI_TEST_CLASS_DEFINITION(test_0703)1128 GUI_TEST_CLASS_DEFINITION(test_0703) {
1129 GTFile::copy(os, dataDir + "samples/Assembly/chrM.fa", sandBoxDir + "1.fa");
1130
1131 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "1.ugenedb"));
1132 GTFileDialog::openFile(os, dataDir + "samples/Assembly/chrM.sorted.bam");
1133 GTUtilsTaskTreeView::waitTaskFinished(os);
1134
1135 GTUtilsTaskTreeView::waitTaskFinished(os);
1136
1137 GTFileDialog::openFile(os, sandBoxDir + "1.fa");
1138 GTUtilsTaskTreeView::waitTaskFinished(os);
1139
1140 GTUtilsMdi::activateWindow(os, "chrM [1.ugenedb]");
1141
1142 GTUtilsProjectTreeView::dragAndDrop(os, GTUtilsProjectTreeView::findIndex(os, "chrM", GTUtilsProjectTreeView::findIndex(os, "1.fa")), GTUtilsMdi::activeWindow(os));
1143
1144 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::No));
1145 GTUtilsDocument::removeDocument(os, "1.fa");
1146 GTUtilsDocument::removeDocument(os, "1.ugenedb");
1147
1148 GTFile::removeDir(sandBoxDir + "1.fa");
1149
1150 // 1) Opened a BAM file that had a reference sequence associated with it, but there shouldn't be such sequence anymore.
1151 GTFileDialog::openFile(os, sandBoxDir + "1.ugenedb");
1152 GTUtilsTaskTreeView::waitTaskFinished(os);
1153
1154 // Expected state : UGENE not crashes
1155 }
1156
GUI_TEST_CLASS_DEFINITION(test_0733)1157 GUI_TEST_CLASS_DEFINITION(test_0733) {
1158 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1159 // 1. Drop "Write sequence" element on the scheme
1160 // Expected state: workflow designer opens, one empty write sequence element is presented.
1161 WorkflowProcessItem *writer = GTUtilsWorkflowDesigner::addElement(os, "Write Sequence");
1162
1163 // 2. Select this element.
1164 GTUtilsWorkflowDesigner::click(os, writer);
1165
1166 // Expected state: Property editor appears, {parameters->Document format} is "fasta"
1167 QString format = GTUtilsWorkflowDesigner::getParameter(os, "Document format");
1168 CHECK_SET_ERR("FASTA" == format, "Wrong format");
1169
1170 // 3. Change {Parameters->Output file} to "result.gb".
1171 // Expected state: {Parameters->Output file} is "%some_path%/result.gb", {Parameters->Document format} is "fasta".
1172 GTUtilsWorkflowDesigner::setParameter(os, "Output file", "result.gb", GTUtilsWorkflowDesigner::textValue);
1173
1174 // 4. Change {Parameters->Document Format} to "GenBank" and press Enter.
1175 GTUtilsWorkflowDesigner::setParameter(os, "Document format", "GenBank", GTUtilsWorkflowDesigner::comboValue);
1176
1177 // Expected state: {Parameters->Output file} changes to "%some_path%/result.gb".
1178 QString url = GTUtilsWorkflowDesigner::getParameter(os, "utput file");
1179 CHECK_SET_ERR("result.gb" == url, "Wrong url");
1180 }
1181
GUI_TEST_CLASS_DEFINITION(test_0734)1182 GUI_TEST_CLASS_DEFINITION(test_0734) {
1183 // 1. Open "_common_data/fasta/test.TXT".
1184 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/test.TXT");
1185
1186 // 2. Open "_common_data/clustal/test_alignment.aln".
1187 GTUtilsProject::openFile(os, testDir + "_common_data/clustal/test_alignment.aln");
1188
1189 // Expected state: two documents are opened in the project view; MSA Editor are shown with test_alignment.
1190 GTUtilsProjectTreeView::findIndex(os, "test.TXT"); // checks are inside
1191 GTUtilsProjectTreeView::findIndex(os, "test_alignment.aln"); // checks are inside
1192 QWidget *msaView = GTUtilsMdi::activeWindow(os);
1193 CHECK(nullptr != msaView, );
1194
1195 // 3. Drag'n'drop "Sequence4" object of "test.TXT" document from the project tree to the MSA Editor.
1196 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_LOAD << "Sequence from current project"));
1197 GTUtilsDialog::waitForDialog(os, new ProjectTreeItemSelectorDialogFiller(os, "test.TXT", "Sequence4"));
1198 GTMenu::showContextMenu(os, GTUtilsMdi::activeWindow(os));
1199 GTGlobals::sleep();
1200
1201 // Expected state: UGENE does not crash; a new "Sequence4" row appears in the alignment.
1202 QStringList names = GTUtilsMSAEditorSequenceArea::getNameList(os);
1203 CHECK_SET_ERR(names.size() == 4, QString("Sequence count mismatch. Expected: %1. Actual: %2").arg(4).arg(names.size()));
1204 CHECK_SET_ERR(names.last() == "Sequence4",
1205 QString("Inserted sequence name mismatch. Expected: %1. Actual: %2").arg("Sequence4").arg(names.last()));
1206 }
GUI_TEST_CLASS_DEFINITION(test_0746)1207 GUI_TEST_CLASS_DEFINITION(test_0746) {
1208 // 1. Open file _common_data\scenarios\_regression\764\short.fa
1209 // 2. Make 'Detailed view' visible (if not)
1210 // Expected state: 'Show amino translation' and 'Complement strand' buttons are enabled (not grey)
1211 GTUtilsProject::openFile(os, testDir + "_common_data/scenarios/_regression/764/short.fa");
1212 QWidget *toggleViewButton = GTWidget::findWidget(os, "toggleViewButton");
1213 Runnable *chooser = new PopupChooser(os, QStringList() << "toggleDetailsView");
1214 GTUtilsDialog::waitForDialog(os, chooser);
1215 GTWidget::click(os, toggleViewButton);
1216 GTGlobals::sleep();
1217
1218 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList() << "do_not_translate_radiobutton", PopupChecker::IsEnabled));
1219 GTWidget::click(os, GTWidget::findWidget(os, "translationsMenuToolbarButton"));
1220 GTGlobals::sleep();
1221 QAbstractButton *complement = GTAction::button(os, "complement_action");
1222 CHECK_SET_ERR(complement->isEnabled() == true, "button is not enabled");
1223 }
1224
GUI_TEST_CLASS_DEFINITION(test_0750)1225 GUI_TEST_CLASS_DEFINITION(test_0750) {
1226 // 1. Open the Workflow Designer.
1227 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1228 // 2. Enable the scripting mode (select "Actions > Scripting mode > Show scripting options").
1229 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Show scripting options"));
1230 GTWidget::click(os, GTAction::button(os, GTAction::findActionByText(os, "Scripting mode")));
1231 // 3. Drag the "Read from remote database" element to the Scene.
1232 GTUtilsWorkflowDesigner::addElement(os, "Read Sequence from Remote Database");
1233 // 4. Press the "..." button of the "Resource IDs" value cell.
1234
1235 class Custom : public CustomScenario {
1236 public:
1237 void run(HI::GUITestOpStatus &os) {
1238 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1239 GTWidget::click(os, GTWidget::findButtonByText(os, "Cancel", dialog));
1240 }
1241 };
1242 GTUtilsDialog::waitForDialog(os, new DefaultDialogFiller(os, "", QDialogButtonBox::Ok, new Custom()));
1243 QTableView *table = GTWidget::findExactWidget<QTableView *>(os, "table");
1244 GTMouseDriver::moveTo(GTTableView::getCellPoint(os, table, 2, 1));
1245 GTMouseDriver::click();
1246 GTGlobals::sleep(500);
1247 GTWidget::click(os, GTWidget::findButtonByText(os, "...", table));
1248 // 5. Close the appeared dialog.
1249 CHECK_SET_ERR(!table->selectionModel()->hasSelection(), "Selection unexpectidly presents");
1250 // Expected state: script cell didn't selected
1251 }
1252
GUI_TEST_CLASS_DEFINITION(test_0762)1253 GUI_TEST_CLASS_DEFINITION(test_0762) {
1254 // 1. Open human_T1.fa from examples
1255 //
1256 // 2. Try search tandems with default settings and with new Annotations Table.
1257 // Expected state: UGENE not crashes
1258 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
1259 GTUtilsTaskTreeView::waitTaskFinished(os);
1260 GTUtilsTaskTreeView::waitTaskFinished(os);
1261
1262 GTUtilsDialog::waitForDialog(os, new FindTandemsDialogFiller(os, sandBoxDir + "test_0762.gb"));
1263 GTToolbar::clickButtonByTooltipOnToolbar(os, MWTOOLBAR_ACTIVEMDI, "Find tandem repeats");
1264 GTGlobals::sleep();
1265 GTUtilsTaskTreeView::waitTaskFinished(os);
1266 }
1267
GUI_TEST_CLASS_DEFINITION(test_0768)1268 GUI_TEST_CLASS_DEFINITION(test_0768) {
1269 // 1. Open WD. Press toolbar button "Create script object".
1270 // Expected state: Create element with script dialog appears.
1271
1272 // 2. Fill the next field in dialog:
1273 // {Name} 123
1274
1275 // 3. Click OK button.
1276
1277 // GTUtilsDialog::waitForDialog(os, new StartupDialogFiller(os));
1278 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1279 GTGlobals::sleep(500);
1280
1281 QTreeWidget *w = qobject_cast<QTreeWidget *>(GTWidget::findWidget(os, "WorkflowPaletteElements"));
1282 CHECK_SET_ERR(w != nullptr, "WorkflowPaletteElements is null");
1283
1284 QTreeWidgetItem *foundItem = nullptr;
1285 QList<QTreeWidgetItem *> outerList = w->findItems("", Qt::MatchContains);
1286 for (int i = 0; i < outerList.count(); i++) {
1287 QList<QTreeWidgetItem *> innerList;
1288
1289 for (int j = 0; j < outerList.value(i)->childCount(); j++) {
1290 innerList.append(outerList.value(i)->child(j));
1291 }
1292
1293 foreach (QTreeWidgetItem *item, innerList) {
1294 QString s = item->data(0, Qt::UserRole).value<QAction *>()->text();
1295 if (s == "test_0768") {
1296 foundItem = item;
1297 }
1298 }
1299 }
1300 if (foundItem != nullptr) {
1301 GTUtilsWorkflowDesigner::setCurrentTab(os, GTUtilsWorkflowDesigner::algorithms);
1302 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Remove"));
1303 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "", "Remove element"));
1304 GTUtilsWorkflowDesigner::clickOnPalette(os, "test_0768", Qt::RightButton);
1305 GTUtilsMdi::click(os, GTGlobals::Close);
1306 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1307 GTGlobals::sleep();
1308 }
1309
1310 GTUtilsDialog::waitForDialog(os, new CreateElementWithScriptDialogFiller(os, "test_0768"));
1311 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
1312 << "Create element with script...",
1313 GTGlobals::UseMouse);
1314
1315 // 4. Select created worker. Press toolbar button "Edit script text".
1316 // Expected state: Script editor dialog appears.
1317
1318 // 5. Paste "xyz" at the script text area. Click "Check syntax" button
1319 // Expected state: messagebox "Syntax is OK!" appears.
1320
1321 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "test_0768"));
1322 GTMouseDriver::click();
1323
1324 GTUtilsDialog::waitForDialog(os, new ScriptEditorDialogSyntaxChecker(os, "xyz", "Syntax is OK!"));
1325 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
1326 << "Edit script of the element...",
1327 GTGlobals::UseMouse);
1328 }
1329
GUI_TEST_CLASS_DEFINITION(test_0774)1330 GUI_TEST_CLASS_DEFINITION(test_0774) {
1331 // 1. Create new scheme in Workflow Designer: "Read sequence" > "Write sequence".
1332 // 2. Input two files in the "Input files" parameter of the "Read sequence" element.
1333 // 3. Select "Merge" in the "Mode" parameter of the "Read sequence" element.
1334 // 4. Set location of an output data file in the "Output file" parameter of the "Write sequence".
1335 // 5. Run the schema.
1336 // Expected result: The scheme finished successfully.
1337 // 6. Open the result file in Sequence View.
1338 // Expected result: The result file contains two sequences. Each sequence is merged sequences from
1339 // each input file respectively.
1340
1341 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1342
1343 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
1344 CHECK_SET_ERR(read != nullptr, "Read Sequence element not found");
1345 // GTUtilsWorkflowDesigner::setDatasetInputFolder(os, dataDir + "samples/Genbank");
1346 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Genbank/murine.gb");
1347 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Genbank/sars.gb");
1348 GTUtilsWorkflowDesigner::setParameter(os, "Mode", "Merge", GTUtilsWorkflowDesigner::comboValue);
1349
1350 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Sequence");
1351 CHECK_SET_ERR(write != nullptr, "Write Sequence element not found");
1352 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir(sandBoxDir).absolutePath() + "/test_0774", GTUtilsWorkflowDesigner::textValue);
1353
1354 GTUtilsWorkflowDesigner::connect(os, read, write);
1355
1356 GTUtilsWorkflowDesigner::runWorkflow(os);
1357 GTUtilsTaskTreeView::waitTaskFinished(os);
1358 GTGlobals::sleep();
1359
1360 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os));
1361 GTUtilsProject::openFile(os, sandBoxDir + "/test_0774");
1362 GTUtilsTaskTreeView::waitTaskFinished(os);
1363
1364 CHECK_SET_ERR(GTUtilsSequenceView::getSeqWidgetsNumber(os) == 2, "Incorrect count of sequences");
1365 }
1366
GUI_TEST_CLASS_DEFINITION(test_0775)1367 GUI_TEST_CLASS_DEFINITION(test_0775) {
1368 // 1. Open human_T1.fa sequence
1369 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
1370 GTUtilsTaskTreeView::waitTaskFinished(os);
1371 GTWidget::click(os, GTWidget::findWidget(os, "ADV_single_sequence_widget_0"));
1372 GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os, "1..2,5..10,15..20"));
1373 // GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os, 10, 20));
1374 GTKeyboardDriver::keyClick('a', Qt::ControlModifier);
1375 // 2. Open "Region selection" dialog {Ctrl+a} fill it with next data:
1376 // {Multiple range selection} checked
1377 // {Multi region:} 1..2,5..10,15..20
1378
1379 // 3. Press 'Go' button
1380 // Expected state: this regions are selected on the view
1381 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_COPY << "Copy sequence"));
1382 GTWidget::click(os, GTUtilsSequenceView::getSeqWidgetByNumber(os)->getDetView(), Qt::RightButton);
1383 GTGlobals::sleep(500);
1384 QString text = GTClipboard::text(os);
1385 CHECK_SET_ERR(text == "TTCAGATTAAAGTT", "unexpected selection: " + text);
1386 }
1387
GUI_TEST_CLASS_DEFINITION(test_0776)1388 GUI_TEST_CLASS_DEFINITION(test_0776) {
1389 /* 1. Open WD.
1390 * 2. Create a scheme with the "Search for TFBS with weight matrix" element.
1391 * 3. Run the scheme with following parameters: input sequence - human_t1, input weight matrix - position_weight_matrix/UniPROBE/Cell08/Alx3_3418.2.pwm.
1392 * Expected state: error report "Bad sequence supplied to Weight Matrix Search" doesn't appear
1393 */
1394 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1395 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
1396 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/FASTA/human_T1.fa");
1397
1398 WorkflowProcessItem *readWM = GTUtilsWorkflowDesigner::addElement(os, "Read Weight Matrix");
1399 GTUtilsWorkflowDesigner::setParameter(os, "Input file(s)", QDir(dataDir).absolutePath() + "/position_weight_matrix/UniPROBE/Cell08/Alx3_3418.2.pwm", GTUtilsWorkflowDesigner::textValue);
1400
1401 WorkflowProcessItem *search = GTUtilsWorkflowDesigner::addElement(os, "Search for TFBS with Weight Matrix");
1402 // Search for TFBS with Weight Matrix
1403
1404 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Sequence", true);
1405
1406 GTUtilsWorkflowDesigner::connect(os, read, search);
1407 GTUtilsWorkflowDesigner::connect(os, readWM, search);
1408 GTUtilsWorkflowDesigner::connect(os, search, write);
1409
1410 GTUtilsWorkflowDesigner::click(os, write);
1411 GTUtilsWorkflowDesigner::setParameter(os, "Document format", "GenBank", GTUtilsWorkflowDesigner::comboValue);
1412 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir(sandBoxDir).absolutePath() + "/test_0776.gb", GTUtilsWorkflowDesigner::textValue);
1413
1414 GTUtilsWorkflowDesigner::runWorkflow(os);
1415 GTUtilsTaskTreeView::waitTaskFinished(os);
1416 }
1417
GUI_TEST_CLASS_DEFINITION(test_0778)1418 GUI_TEST_CLASS_DEFINITION(test_0778) {
1419 // 1. Open file _common_data\scenarios\_regression\778\mixed.fa
1420 // 2. Open menu {Settings->Prfrences}
1421 // Expected state: Application settings dialog opened
1422 // 3. Select File format section, set {Create annotations for case switchings:} "Upper case annotation" and press OK button
1423 // Expected state: sequence view reopened, sequence marked with two "upper_case" annotations with coodinates 1..4, 8..10
1424 // 4. Open menu {Settings->Prfrences}
1425 // Expected state: Application settings dialog opened
1426 // 5. Select File format section, set {Create annotations for case switchings:} "Lower case annotation" and press OK button
1427 // Expected state: sequence view reopened, sequence marked with two "upper_case" annotations with coodinates 5..7, 11..13
1428
1429 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/778/mixed.fa");
1430 GTUtilsTaskTreeView::waitTaskFinished(os);
1431
1432 class CaseAnnotations : public CustomScenario {
1433 public:
1434 CaseAnnotations(QString name = QString())
1435 : name(name) {
1436 }
1437 void run(HI::GUITestOpStatus &os) {
1438 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1439 AppSettingsDialogFiller::openTab(os, AppSettingsDialogFiller::FileFormat);
1440
1441 QComboBox *caseCombo = qobject_cast<QComboBox *>(GTWidget::findWidget(os, "caseCombo"));
1442 CHECK_SET_ERR(caseCombo != nullptr, "No caseCombo");
1443 GTComboBox::selectItemByText(os, caseCombo, name);
1444
1445 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
1446 }
1447
1448 private:
1449 QString name;
1450 };
1451
1452 GTUtilsDialog::waitForDialog(os, new AppSettingsDialogFiller(os, new CaseAnnotations("Use upper case annotations")));
1453 GTMenu::clickMainMenuItem(os, QStringList() << "Settings"
1454 << "Preferences...");
1455 GTGlobals::sleep();
1456
1457 QList<U2Region> regions = GTUtilsAnnotationsTreeView::getAnnotatedRegions(os);
1458 CHECK_SET_ERR(regions.size() == 2, "Annotated regions number is incorrect");
1459 CHECK_SET_ERR(regions.contains(U2Region(0, 4)), "No annotation 1..4");
1460 CHECK_SET_ERR(regions.contains(U2Region(7, 3)), "No annotation 8..10");
1461
1462 GTUtilsDialog::waitForDialog(os, new AppSettingsDialogFiller(os, new CaseAnnotations("Use lower case annotations")));
1463 GTMenu::clickMainMenuItem(os, QStringList() << "Settings"
1464 << "Preferences...");
1465 GTGlobals::sleep();
1466
1467 regions = GTUtilsAnnotationsTreeView::getAnnotatedRegions(os);
1468 CHECK_SET_ERR(regions.size() == 2, "Annotated regions number is incorrect");
1469 CHECK_SET_ERR(regions.contains(U2Region(4, 3)), "No annotation 1..4");
1470 CHECK_SET_ERR(regions.contains(U2Region(10, 3)), "No annotation 8..10");
1471
1472 GTGlobals::sleep();
1473 }
1474
GUI_TEST_CLASS_DEFINITION(test_0779)1475 GUI_TEST_CLASS_DEFINITION(test_0779) {
1476 // 1.Create a simple scheme with two elements:
1477 // The Read sequence element
1478 // The Write annotations element
1479 // 2. Connect the elements.
1480 // 3. Switch the "File format" property of the Write annotations element from "GenBank" (defualt) to "csv".
1481 // 4. Click on the scheme area and you will get the crash.
1482 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1483 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
1484 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Annotations", true);
1485 GTUtilsWorkflowDesigner::setParameter(os, "Document format", "CSV", GTUtilsWorkflowDesigner::comboValue);
1486 GTGlobals::sleep(500);
1487 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence"), GTUtilsWorkflowDesigner::getWorker(os, "Write Annotations"));
1488 }
1489
GUI_TEST_CLASS_DEFINITION(test_0782)1490 GUI_TEST_CLASS_DEFINITION(test_0782) {
1491 // 1. Open file data/samples/FASTA/human_T1.fa in sequence view.
1492 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
1493 GTUtilsTaskTreeView::waitTaskFinished(os);
1494 // 2. Build graph - {Graphs -> GC content (%)}.
1495 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "GC Content (%)"));
1496 GTWidget::click(os, GTWidget::findWidget(os, "GraphMenuAction"));
1497 // 3. Press right mouse button in the graph area, choose {Graph -> Graph settings...}.
1498 QWidget *graphView = GTWidget::findWidget(os, "GSequenceGraphViewRenderArea");
1499 GTWidget::click(os, graphView);
1500 QImage init = GTWidget::getImage(os, graphView);
1501 // init.save("/home/vmalin/init", "BMP");
1502 class custom : public CustomScenario {
1503 public:
1504 void run(HI::GUITestOpStatus &os) {
1505 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1506 GTWidget::click(os, GTWidget::findButtonByText(os, "Cancel", dialog));
1507 }
1508 };
1509 GTUtilsDialog::waitForDialog(os, new DefaultDialogFiller(os, "GraphSettingsDialog", QDialogButtonBox::Cancel, new custom));
1510 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Graph"
1511 << "visual_properties_action"));
1512 GTWidget::click(os, graphView, Qt::RightButton);
1513 // 4. In "Graph Settings" dialog change graph's color, then press "Cancel".
1514 GTWidget::click(os, graphView);
1515 // Expected result: Graph's color didn't change.
1516 QImage final = GTWidget::getImage(os, graphView);
1517 // final.save("/home/vmalin/final", "BMP");
1518
1519 CHECK_SET_ERR(final == init, "graph view changed");
1520 // 5. Repeat the third step, then check "Cutoff for minimum and maximum values".
1521
1522 // 6. Try to apply dialog with different values, in fields "Minimum" and "Maximum".
1523
1524 // Expected result: Cutoff graph is drawn correctly.
1525 }
1526
GUI_TEST_CLASS_DEFINITION(test_0786)1527 GUI_TEST_CLASS_DEFINITION(test_0786) {
1528 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1529
1530 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
1531 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Sequence", true);
1532
1533 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence"), GTUtilsWorkflowDesigner::getWorker(os, "Write Sequence"));
1534
1535 GTUtilsWorkflowDesigner::addInputFile(os, "Read Sequence", dataDir + "samples/FASTA/human_T1.fa");
1536 GTUtilsWorkflowDesigner::setParameter(os, "Accession filter", "NC_001363", GTUtilsWorkflowDesigner::textValue);
1537
1538 GTUtilsWorkflowDesigner::click(os, "Write Sequence");
1539 QFile outputFile(sandBoxDir + "786_out.fa");
1540 QString outputFilePath = QFileInfo(outputFile).absoluteFilePath();
1541 GTUtilsWorkflowDesigner::setParameter(os, "Output file", outputFilePath, GTUtilsWorkflowDesigner::textValue);
1542
1543 GTUtilsWorkflowDesigner::runWorkflow(os);
1544 GTUtilsTaskTreeView::waitTaskFinished(os);
1545
1546 CHECK_SET_ERR(!outputFile.exists(outputFilePath), "File should not exist");
1547 }
1548
GUI_TEST_CLASS_DEFINITION(test_0792)1549 GUI_TEST_CLASS_DEFINITION(test_0792) {
1550 // 1) Open WD
1551 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1552 // 2) Put "Read Sequence" worker on the scheme
1553 GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
1554 // Expected state: Dataset view opened
1555
1556 // 3) Click "Add folder", select data/samples/Genbank
1557 QString dir;
1558 #ifdef Q_OS_WIN
1559 dir = dataDir + "samples/Genbank/*";
1560 #else
1561 dir = dataDir + "samples/Genbank";
1562 #endif
1563 GTUtilsWorkflowDesigner::setDatasetInputFolder(os, dir);
1564 // 4) Click on appeared item in the file list
1565 QWidget *datasetWidget = GTWidget::findWidget(os, "DatasetWidget");
1566 QListWidget *items = GTWidget::findExactWidget<QListWidget *>(os, "itemsArea", datasetWidget);
1567 GTListWidget::click(os, items, "Genbank", Qt::RightButton);
1568 // Expected state:
1569 // the following widgets appears:
1570 GTWidget::findExactWidget<QLineEdit *>(os, "includeMaskEdit");
1571 GTWidget::findExactWidget<QLineEdit *>(os, "excludeMaskEdit");
1572 GTWidget::findExactWidget<QCheckBox *>(os, "recursiveBox");
1573 // Include mask, Exclude mask lineedits;
1574 // Recursive checkbox
1575 GTWidget::click(os, GTUtilsMdi::activeWindow(os));
1576 }
1577
GUI_TEST_CLASS_DEFINITION(test_0798)1578 GUI_TEST_CLASS_DEFINITION(test_0798) {
1579 // 1. File -> Open As.
1580 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Merge));
1581 GTUtilsDialog::waitForDialog(os, new DocumentFormatSelectorDialogFiller(os, "GenBank"));
1582 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/scenarios/_regression/798", "1.gb"));
1583 GTMenu::clickMainMenuItem(os, QStringList() << "File"
1584 << "Open as...");
1585 GTUtilsTaskTreeView::waitTaskFinished(os);
1586 // 2. Choose the file "_common_data/scenarios/_regression/798/1.gb" as Genbank in merging mode with default parametes.
1587 QList<QTreeWidgetItem *> list = GTUtilsAnnotationsTreeView::findItems(os, "source");
1588 QString s1 = list.first()->text(2);
1589 QString s2 = list.last()->text(2);
1590 CHECK_SET_ERR(s1 == "1..117046", "unexpected coordinates1: " + s1);
1591 CHECK_SET_ERR(s2 == "117057..143727", "unexpected coordinates2: " + s2);
1592 // Expected state: there is 2 annotations named 'source' with coordinates 1..117046 and 117057..143727
1593 }
1594
GUI_TEST_CLASS_DEFINITION(test_0801)1595 GUI_TEST_CLASS_DEFINITION(test_0801) {
1596 // 1. Open human_T1.fa sequence
1597 // 2. Open find pattern tab on options panel {Ctrl+f}. Fill fields with next data:
1598 // {Search for} AAAGCTTTA
1599 // {Region} Custom region 2 5
1600 // Expected state: UGENE does not crash}
1601 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
1602 GTUtilsTaskTreeView::waitTaskFinished(os);
1603 GTUtilsOptionsPanel::runFindPatternWithHotKey("AAAGCTTTA", os);
1604 GTUtilsOptionPanelSequenceView::setRegionType(os, "Custom region");
1605 GTLineEdit::setText(os, qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "editStart")), "2");
1606 GTLineEdit::setText(os, qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "editEnd")), "5");
1607 }
1608
GUI_TEST_CLASS_DEFINITION(test_0807)1609 GUI_TEST_CLASS_DEFINITION(test_0807) {
1610 QString somenameEtcFile = sandBoxDir + "807.etc";
1611 QFile::copy(testDir + "_common_data/scenarios/workflow designer/somename.etc", somenameEtcFile);
1612
1613 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1614 GTUtilsWorkflowDesigner::removeCmdlineWorkerFromPalette(os, "somename");
1615
1616 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, somenameEtcFile));
1617 GTWidget::click(os, GTAction::button(os, "AddElementWithCommandLineTool"));
1618
1619 CreateElementWithCommandLineToolFiller::ElementWithCommandLineSettings settings;
1620 settings.tool = "bedtools";
1621 settings.command = "testtest $in";
1622 GTUtilsDialog::waitForDialog(os, new CreateElementWithCommandLineToolFiller(os, settings));
1623
1624 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "editConfiguration"));
1625 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "somename"));
1626 GTMouseDriver::click();
1627 GTMouseDriver::click(Qt::RightButton);
1628
1629 class ResetAndApplyScenario : public CustomScenario {
1630 public:
1631 void run(HI::GUITestOpStatus &os) {
1632 QWidget *nextButton = GTWidget::findWidget(os, "__qt__passive_wizardbutton1");
1633 GTWidget::click(os, nextButton);
1634 GTWidget::click(os, GTWidget::findWidget(os, "pbDeleteInput"));
1635 GTWidget::click(os, nextButton);
1636 GTWidget::click(os, nextButton);
1637 GTWidget::click(os, nextButton);
1638 GTWidget::click(os, nextButton);
1639 GTWidget::click(os, nextButton);
1640 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Reset));
1641 GTWidget::click(os, GTWidget::findButtonByText(os, "Finish"));
1642
1643 // Same wizard is shown now. The first page is opened.
1644
1645 GTWidget::click(os, nextButton);
1646 GTWidget::click(os, GTWidget::findWidget(os, "pbDeleteInput"));
1647 GTWidget::click(os, nextButton);
1648 GTWidget::click(os, nextButton);
1649 GTWidget::click(os, nextButton);
1650 GTWidget::click(os, nextButton);
1651 GTWidget::click(os, nextButton);
1652 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Apply));
1653 GTWidget::click(os, GTWidget::findButtonByText(os, "Finish"));
1654 }
1655 };
1656 GTUtilsDialog::waitForDialog(os, new CreateElementWithCommandLineToolFiller(os, new ResetAndApplyScenario()));
1657 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "editConfiguration"));
1658 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "somename"));
1659 GTMouseDriver::click();
1660 GTMouseDriver::click(Qt::RightButton);
1661 GTUtilsDialog::waitAllFinished(os);
1662
1663 class ApplyScenario : public CustomScenario {
1664 public:
1665 void run(HI::GUITestOpStatus &os) {
1666 QWidget *nextButton = GTWidget::findWidget(os, "__qt__passive_wizardbutton1");
1667 GTWidget::click(os, nextButton);
1668 GTWidget::click(os, GTWidget::findWidget(os, "pbDeleteInput"));
1669 GTWidget::click(os, nextButton);
1670 GTWidget::click(os, nextButton);
1671 GTWidget::click(os, nextButton);
1672 GTWidget::click(os, nextButton);
1673 GTWidget::click(os, nextButton);
1674 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "Apply"));
1675 GTWidget::click(os, GTWidget::findButtonByText(os, "Finish"));
1676 }
1677 };
1678
1679 // Expected state: element disappeared from the scene.
1680 CHECK_SET_ERR(GTUtilsWorkflowDesigner::getWorkers(os).isEmpty(), "The worker is not deleted");
1681 }
1682
GUI_TEST_CLASS_DEFINITION(test_0808)1683 GUI_TEST_CLASS_DEFINITION(test_0808) {
1684 // 1. Create a scheme with the "Read sequence" element and the "Write sequence" element, human_t1.da as an input sequence
1685 // 2. Set the "Split sequence" option of the "Write sequence" element to 2
1686 // 3. Run the scheme
1687
1688 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1689
1690 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Sequence", true);
1691 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Sequence", true);
1692
1693 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence"), GTUtilsWorkflowDesigner::getWorker(os, "Write Sequence"));
1694
1695 GTUtilsWorkflowDesigner::click(os, "Read Sequence");
1696 GTUtilsWorkflowDesigner::addInputFile(os, "Read Sequence", dataDir + "samples/FASTA/human_T1.fa");
1697 GTUtilsWorkflowDesigner::click(os, "Write Sequence");
1698 GTUtilsWorkflowDesigner::setParameter(os, "Split sequence", "2", GTUtilsWorkflowDesigner::spinValue);
1699
1700 GTUtilsWorkflowDesigner::runWorkflow(os);
1701 GTUtilsTaskTreeView::waitTaskFinished(os);
1702 }
1703
GUI_TEST_CLASS_DEFINITION(test_0812)1704 GUI_TEST_CLASS_DEFINITION(test_0812) {
1705 // 1. Create a "seq.txt" file in <some_path> location.
1706 // 2. Click "Create element with external tool".
1707 // 3. Input a name.
1708 // 4. Specify a slot.
1709 // 5. There is no need to add a parameter.
1710 // 6. Input the following execution string: "copy <some_path>\seq.txt <some_path>\seq2.txt" (change <some_path> to your location).
1711 // or the following execution string: "copy "<some_path>\seq.txt" "<some_path>\seq3.txt"" (with quotes for paths).
1712 // 7. Execute the schema (that contains this element only).
1713 // => The schema executes successfully.
1714 // 4. Verify whether the file has been copied.
1715
1716 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1717
1718 CreateElementWithCommandLineToolFiller::ElementWithCommandLineSettings settings;
1719 settings.elementName = "Element_0812";
1720
1721 QList<CreateElementWithCommandLineToolFiller::InOutData> input;
1722 CreateElementWithCommandLineToolFiller::InOutDataType inOutDataType;
1723 inOutDataType.first = CreateElementWithCommandLineToolFiller::Sequence;
1724 inOutDataType.second = "FASTA";
1725 input << CreateElementWithCommandLineToolFiller::InOutData("in1",
1726 inOutDataType);
1727 settings.input = input;
1728 settings.command = "copy _common_data/scenarios/_regression/812/seq.txt _common_data/scenarios/_regression/812/seq2.txt";
1729
1730 // GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "Continue"));
1731
1732 GTUtilsDialog::waitForDialog(os, new CreateElementWithCommandLineToolFiller(os, settings));
1733 QAbstractButton *createElement = GTAction::button(os, "createElementWithCommandLineTool");
1734 GTWidget::click(os, createElement);
1735 GTGlobals::sleep();
1736 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "Ok"));
1737
1738 GTUtilsWorkflowDesigner::runWorkflow(os);
1739 GTUtilsTaskTreeView::waitTaskFinished(os);
1740 }
GUI_TEST_CLASS_DEFINITION(test_0814)1741 GUI_TEST_CLASS_DEFINITION(test_0814) {
1742 // 1. Open UGENE preferences in main menu.
1743 // Expected state: "Application settings" dialog appeared.
1744 // 2. Go to the {Logging} part.
1745 // Expected state: logging settings were shown.
1746 // 3. Check the {Save output to file} checkbox, click OK button.
1747 // Expected state: warning message appeared.
1748 // 4. Close warning message.
1749 // Expected state: "Application settings" dialog closed.
1750 // 5. Repeat steps 1-3.
1751 // Expected state: logging settings were shown, {Save output to file} checkbox is unchecked.
1752 // 6. Check the {Save output to file} checkbox, enter some file (manually or by select file dialog) and click OK button.
1753 // Expected state: "Application settings dialog" closed without any messages.
1754 // 7. Find your file on on the disk.
1755 // Expected state: log file exists.
1756
1757 class LogFile_1 : public CustomScenario {
1758 public:
1759 LogFile_1(QString name = QString())
1760 : name(name) {
1761 }
1762 void run(HI::GUITestOpStatus &os) {
1763 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1764 AppSettingsDialogFiller::openTab(os, AppSettingsDialogFiller::Logging);
1765
1766 QCheckBox *fileOut = qobject_cast<QCheckBox *>(GTWidget::findWidget(os, "fileOutCB"));
1767 CHECK_SET_ERR(fileOut != nullptr, "No fileOutCB");
1768 CHECK_SET_ERR(!fileOut->isChecked(), "CheckBox is checked!");
1769 GTCheckBox::setChecked(os, fileOut);
1770
1771 QLineEdit *fileName = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "outFileEdit"));
1772 CHECK_SET_ERR(fileName != nullptr, "No outFileEdit");
1773 GTLineEdit::setText(os, fileName, name);
1774
1775 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
1776 }
1777
1778 private:
1779 QString name;
1780 };
1781
1782 GTLogTracer l;
1783
1784 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
1785
1786 GTUtilsDialog::waitForDialog(os, new AppSettingsDialogFiller(os, new LogFile_1()));
1787 GTMenu::clickMainMenuItem(os, QStringList() << "Settings"
1788 << "Preferences...");
1789 GTGlobals::sleep();
1790
1791 GTUtilsDialog::waitForDialog(os, new AppSettingsDialogFiller(os, new LogFile_1(QDir(sandBoxDir).absolutePath() + "test_0814_log")));
1792 GTMenu::clickMainMenuItem(os, QStringList() << "Settings"
1793 << "Preferences...");
1794
1795 CHECK_SET_ERR(GTFile::check(os, QDir(sandBoxDir).absolutePath() + "test_0814_log") == true, "Log file not found");
1796 }
1797
GUI_TEST_CLASS_DEFINITION(test_0821)1798 GUI_TEST_CLASS_DEFINITION(test_0821) {
1799 // 1. Open files samples/genbank/sars.gb and samples/genbank/murine.gb in merge mode
1800 // Expected state: annotations in both files has right coordinates
1801
1802 GTSequenceReadingModeDialog::mode = GTSequenceReadingModeDialog::Merge;
1803 GTUtilsDialog::waitForDialog(os, new GTSequenceReadingModeDialogUtils(os));
1804 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils_list(os, dataDir + "samples/Genbank/", QStringList() << "sars.gb"
1805 << "murine.gb"));
1806 GTMenu::clickMainMenuItem(os, QStringList() << "File"
1807 << "Open...");
1808
1809 GTGlobals::sleep(5000);
1810
1811 // TODO: QList<U2Region> cds = GTUtilsAnnotationsTreeView::getAnnotatedRegionsOfGroup(os, "contig (0, 2)");
1812 // TODO: CHECK_SET_ERR( cds.contains(U2Region(0, 5833)), "No 1..5833 region");
1813 }
1814
GUI_TEST_CLASS_DEFINITION(test_0828)1815 GUI_TEST_CLASS_DEFINITION(test_0828) {
1816 // 1. Open WD.
1817 // 2. Add to scheme "Sequence marker" element.
1818 // 3. In property editor groupbox "Parameters" press "Add" button.
1819 // Expected state: "Create marker group" dialog appears, its combobox "Marker group type" contains field "Sequence name markers".
1820 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1821 GTUtilsWorkflowDesigner::addElement(os, "Sequence Marker");
1822 GTUtilsWorkflowDesigner::click(os, "Sequence Marker");
1823
1824 QToolButton *addButton = qobject_cast<QToolButton *>(GTWidget::findWidget(os, "addButton"));
1825 CHECK_SET_ERR(addButton != nullptr, "AddButton not found!");
1826
1827 class OkClicker : public Filler {
1828 public:
1829 OkClicker(HI::GUITestOpStatus &_os)
1830 : Filler(_os, "EditMarkerGroupDialog") {
1831 }
1832 virtual void run() {
1833 QWidget *w = QApplication::activeWindow();
1834 CHECK(nullptr != w, );
1835 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
1836 CHECK(nullptr != buttonBox, );
1837
1838 QComboBox *combo = qobject_cast<QComboBox *>(GTWidget::findWidget(os, "typeBox"));
1839 GTComboBox::selectItemByText(os, combo, "Sequence name markers");
1840
1841 QPushButton *button = buttonBox->button(QDialogButtonBox::Cancel);
1842 CHECK(nullptr != button, );
1843 GTWidget::click(os, button);
1844 }
1845 };
1846 GTUtilsDialog::waitForDialog(os, new OkClicker(os));
1847 GTWidget::click(os, addButton);
1848 GTGlobals::sleep(2000);
1849 }
1850
GUI_TEST_CLASS_DEFINITION(test_0829)1851 GUI_TEST_CLASS_DEFINITION(test_0829) {
1852 // 1. Add input files into CAP3, for example, 1.fa, 2.fa, 3.fa and press "Run". The result contig name will be "3.cap.ace".
1853 // 2. Add input files into CAP3, for example, 4.fa, 5.fa, 3.fa and press "Run". The result contig name will be "3.cap.ace". But error occurs:
1854 // Bug state:
1855 //[20:46:07] 'CAP3SupportTask' task failed: Subtask {Opening view for document: 3.cap.ace} is failed: Subtask {Adding document to project: D:/Documents/tests/3.cap.ace} is failed: Document is already added to the project D:/Documents/tests/3.cap.ace.
1856 // Expected state:
1857 // Dialog with the following options appears: rewrite the existent file, rename the new file or cancel.
1858 GTLogTracer lt;
1859 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
1860
1861 WorkflowProcessItem *readSeq = GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
1862 WorkflowProcessItem *cap3 = GTUtilsWorkflowDesigner::addElement(os, "Assembly Sequences with CAP3", true);
1863
1864 GTUtilsWorkflowDesigner::connect(os, readSeq, cap3);
1865
1866 GTUtilsWorkflowDesigner::click(os, "Read Sequence");
1867 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/scenarios/_regression/829/1.fa");
1868 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/scenarios/_regression/829/2.fa");
1869 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/scenarios/_regression/829/3.fa");
1870
1871 GTUtilsWorkflowDesigner::runWorkflow(os);
1872 GTUtilsTaskTreeView::waitTaskFinished(os);
1873 QApplication::activeWindow();
1874 GTWidget::click(os,
1875 GTToolbar::getWidgetForActionObjectName(os,
1876 GTToolbar::getToolbar(os, "mwtoolbar_activemdi"),
1877 "toggleDashboard"));
1878
1879 GTUtilsWorkflowDesigner::removeItem(os, "Read Sequence");
1880 GTUtilsWorkflowDesigner::removeItem(os, "Assembly Sequences with CAP3");
1881
1882 readSeq = GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
1883 cap3 = GTUtilsWorkflowDesigner::addElement(os, "Assembly Sequences with CAP3");
1884
1885 GTUtilsWorkflowDesigner::connect(os, readSeq, cap3);
1886
1887 GTUtilsWorkflowDesigner::click(os, "Read Sequence");
1888 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/scenarios/_regression/829/1.fa");
1889 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/scenarios/_regression/829/2.fa");
1890 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/scenarios/_regression/829/4.fa");
1891
1892 GTUtilsWorkflowDesigner::runWorkflow(os);
1893 GTUtilsTaskTreeView::waitTaskFinished(os);
1894
1895 CHECK_SET_ERR(!lt.hasErrors(), "Errors in log: " + lt.getJoinedErrorString());
1896 }
1897
GUI_TEST_CLASS_DEFINITION(test_0830)1898 GUI_TEST_CLASS_DEFINITION(test_0830) {
1899 // 1) Tools->DNA assembly->Config assembly with CAPS3
1900 // 2) Base ->
1901 // Input Files:
1902 // _common_data/scenarios/CAP3/region2.fa
1903 // _common_data/scenarios/CAP3/region4.fa
1904 // Run
1905 QString outUrl = sandBoxDir + "830.ace";
1906 QFile(outUrl).remove();
1907 GTUtilsDialog::waitForDialog(os, new ImportACEFileFiller(os, false, outUrl));
1908 GTUtilsDialog::waitForDialog(os, new CAP3SupportDialogFiller(os, QStringList() << testDir + "_common_data/scenarios/CAP3/region2.fa" << testDir + "_common_data/scenarios/CAP3/region4.fa", outUrl));
1909 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
1910 << "Sanger data analysis"
1911 << "Reads de novo assembly (with CAP3)...");
1912
1913 // 3) wait for task error, ensure that no output files are in the project
1914 GTUtilsTaskTreeView::waitTaskFinished(os);
1915 GTUtilsProjectTreeView::checkNoItem(os, "830.ugenedb");
1916 }
1917
GUI_TEST_CLASS_DEFINITION(test_0834)1918 GUI_TEST_CLASS_DEFINITION(test_0834) {
1919 GTFileDialog::openFile(os, testDir + "_common_data/genbank/NC_014267.1_cut.gb");
1920 GTUtilsTaskTreeView::waitTaskFinished(os);
1921
1922 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "gene", "gene (0, 1)") == "join(1..74213,77094..140426)",
1923 "Annotation \"gene\" has incorrect location");
1924 }
1925
GUI_TEST_CLASS_DEFINITION(test_0835)1926 GUI_TEST_CLASS_DEFINITION(test_0835) {
1927 // 1. Open, for example, "murine.gb" and "sars.gb".
1928 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
1929 GTUtilsTaskTreeView::waitTaskFinished(os);
1930 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
1931 GTUtilsTaskTreeView::waitTaskFinished(os);
1932
1933 // 2. Open the sequence objects in one Sequence View.
1934 // = > Both sequences are shown in one Sequence View.
1935 QModelIndex idx = GTUtilsProjectTreeView::findIndex(os, "NC_001363");
1936 QWidget *seqView = GTUtilsMdi::activeWindow(os);
1937 CHECK_SET_ERR(seqView != nullptr, "Sequence widget not found");
1938
1939 GTUtilsProjectTreeView::dragAndDrop(os, idx, seqView);
1940
1941 // 3. Enable Circular View for one of the sequences(for example, "murine.gb").
1942 // = > The Circular View with the Restriction Site Map is shown.
1943 GTWidget::click(os, GTWidget::findWidget(os, "CircularViewAction", GTWidget::findWidget(os, "views_tool_bar_NC_004718")));
1944
1945 QWidget *restrictionMapTreeWidget = GTWidget::findWidget(os, "restrictionMapTreeWidget");
1946 CHECK_SET_ERR(nullptr != restrictionMapTreeWidget && restrictionMapTreeWidget->isVisible(),
1947 "Restriction map widget isn't visible unexpectedly");
1948
1949 // 4. Delete the sequence with the Circular View from the Project View.
1950 // = > The sequence has been deleted, the Circular View is not shown.
1951 //!= > The Restriction Site Map is NOT still shown.
1952 GTUtilsProjectTreeView::click(os, "sars.gb");
1953 GTKeyboardDriver::keyClick(Qt::Key_Delete);
1954 GTUtilsTaskTreeView::waitTaskFinished(os);
1955 GTThread::waitForMainThread();
1956
1957 restrictionMapTreeWidget = GTWidget::findWidget(os, "restrictionMapTreeWidget", nullptr, GTGlobals::FindOptions(false));
1958 CHECK_SET_ERR(nullptr == restrictionMapTreeWidget, "Restriction map widget is visible unexpectedly");
1959 }
1960
GUI_TEST_CLASS_DEFINITION(test_0839)1961 GUI_TEST_CLASS_DEFINITION(test_0839) {
1962 // 1. Use menu {Tools->Weight matrix->Build Weight Matrix}.
1963 // Expected state: "Build weight or frequency matrix" dialog appeared.
1964 //
1965 // 2. Click {...} button for "Input item".
1966 // Expected state: "Select file with alignment" dialog appeared.
1967 //
1968 // 3. Open any non msa file (e.g. a tree file - *.nwk format).
1969 // Expected state:
1970 // 1). UGENE doesn`t crach.
1971 // 2). Messagebox about unsupported format appeared.
1972 QList<PwmBuildDialogFiller::Action> actions;
1973 actions << PwmBuildDialogFiller::Action(PwmBuildDialogFiller::ExpectInvalidFile, "");
1974 actions << PwmBuildDialogFiller::Action(PwmBuildDialogFiller::SelectInput, dataDir + "samples/GFF/5prime_utr_intron_A20.gff");
1975 actions << PwmBuildDialogFiller::Action(PwmBuildDialogFiller::ClickCancel, "");
1976 GTUtilsDialog::waitForDialog(os, new PwmBuildDialogFiller(os, actions));
1977
1978 GTMenu::clickMainMenuItem(os, QStringList() << "Tools"
1979 << "Search for TFBS"
1980 << "Build weight matrix...");
1981 GTGlobals::sleep();
1982 }
1983
GUI_TEST_CLASS_DEFINITION(test_0840)1984 GUI_TEST_CLASS_DEFINITION(test_0840) {
1985 //"Digest Into Fragments" displays number of cuts incorrectly
1986 // When enzyme is presented both in auto-annotation and in permanent annotation, the number of cuts shows +1.
1987
1988 class DigestCircularSequenceScenario : public CustomScenario {
1989 public:
1990 void run(HI::GUITestOpStatus &os) {
1991 QWidget *dialog = GTWidget::getActiveModalWidget(os);
1992 QListWidget *availableEnzymeWidget = GTWidget::findExactWidget<QListWidget *>(os, "availableEnzymeWidget", dialog);
1993 CHECK_SET_ERR(nullptr != availableEnzymeWidget, "Cannot find available enzyme list widget");
1994
1995 QList<QListWidgetItem *> items = availableEnzymeWidget->findItems("EcoRV : 1 cut(s)", Qt::MatchExactly);
1996 CHECK_SET_ERR(items.size() == 1, "Unexpected number of enzymes");
1997
1998 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
1999 }
2000 };
2001
2002 class CreateAnnotationScenario : public CustomScenario {
2003 public:
2004 void run(HI::GUITestOpStatus &os) {
2005 QWidget *dialog = GTWidget::getActiveModalWidget(os);
2006 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "leAnnotationName", dialog), "EcoRV");
2007 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "leGroupName", dialog), "enzyme");
2008
2009 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
2010 }
2011 };
2012
2013 // 1. Open "_common_data/enzymes/bsai_reverse_test.fa".
2014 GTFileDialog::openFile(os, testDir + "_common_data/enzymes/bsai_reverse_test.fa");
2015 GTUtilsTaskTreeView::waitTaskFinished(os);
2016
2017 // 2. Click "Find restriction sites" on toolbar.
2018 // 3. Click OK button in dialog appeared.
2019 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "ADV_MENU_ANALYSE"
2020 << "Find restriction sites"));
2021 GTUtilsDialog::waitForDialog(os, new FindEnzymesDialogFiller(os, QStringList("EcoRV")));
2022 GTMenu::showContextMenu(os, GTUtilsSequenceView::getSeqWidgetByNumber(os));
2023 GTUtilsTaskTreeView::waitTaskFinished(os);
2024
2025 // Expected state: One new auto-annotation appears ("enzyme/EcoRV")
2026 // 4. Select this annotation.
2027 CHECK_SET_ERR(1 == GTUtilsAnnotationsTreeView::findItems(os, "EcoRV").size(), "Unexpected annotation count");
2028 GTUtilsAnnotationsTreeView::selectItems(os, QStringList() << "EcoRV");
2029 GTMouseDriver::doubleClick();
2030
2031 // 5. Select "New annotation" in context menu.
2032 // 6. Fill fields with: "Group name" - "enzyme", "Annotation name" - "EcoRV".
2033 // 7. Click Create button.
2034 GTUtilsDialog::waitForDialog(os, new CreateAnnotationWidgetFiller(os, new CreateAnnotationScenario));
2035 GTToolbar::clickButtonByTooltipOnToolbar(os, MWTOOLBAR_ACTIVEMDI, "New annotation");
2036 GTUtilsTaskTreeView::waitTaskFinished(os);
2037
2038 // Expected state: Non-auto annotation appears ("enzyme/EcoRV") for the same region.
2039 QList<QTreeWidgetItem *> items = GTUtilsAnnotationsTreeView::findItems(os, "EcoRV");
2040 CHECK_SET_ERR(2 == items.size(), "Unexpected annotation count");
2041 CHECK_SET_ERR(items[0]->parent() != items[1]->parent(), "Annotations are siblings unexpectedly");
2042
2043 // 8. Select "Actions"->"Cloning"->"Digest into Fragments..." in main menu.
2044 // Expected state: there is only one enzyme in the "Available enzymes" field with 1 cut.
2045 // Bug state: there is one enzyme but with 2 cuts.
2046 GTUtilsDialog::waitForDialog(os, new DigestSequenceDialogFiller(os, new DigestCircularSequenceScenario));
2047 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Cloning"
2048 << "Digest into fragments..."));
2049 GTMenu::showContextMenu(os, GTUtilsSequenceView::getSeqWidgetByNumber(os));
2050 GTUtilsTaskTreeView::waitTaskFinished(os);
2051 }
2052
GUI_TEST_CLASS_DEFINITION(test_0842)2053 GUI_TEST_CLASS_DEFINITION(test_0842) {
2054 // 1) Create some custom cmdline worker with some name ("test", for example).
2055 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2056
2057 GTUtilsWorkflowDesigner::setCurrentTab(os, GTUtilsWorkflowDesigner::algorithms);
2058
2059 QTreeWidgetItem *treeItem = GTUtilsWorkflowDesigner::findTreeItem(os, "test", GTUtilsWorkflowDesigner::algorithms, true, false);
2060 if (treeItem != nullptr) {
2061 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "", "Remove element"));
2062 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Remove"));
2063 GTTreeWidget::click(os, treeItem);
2064 GTMouseDriver::click(Qt::RightButton);
2065 }
2066 QTreeWidgetItem *treeItem1 = GTUtilsWorkflowDesigner::findTreeItem(os, "test1", GTUtilsWorkflowDesigner::algorithms, true, false);
2067 if (treeItem1 != nullptr) {
2068 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "", "Remove element"));
2069 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Remove"));
2070 GTTreeWidget::click(os, treeItem1);
2071 GTMouseDriver::click(Qt::RightButton);
2072 }
2073
2074 const QStringList groupNames = GTUtilsWorkflowDesigner::getPaletteGroupNames(os);
2075 const int customElementsCount = groupNames.contains("Custom Elements with External Tools") ? GTUtilsWorkflowDesigner::getPaletteGroupEntries(os, "Custom Elements with External Tools").size() : 0;
2076
2077 CreateElementWithCommandLineToolFiller::ElementWithCommandLineSettings settings;
2078 settings.elementName = "test";
2079 settings.input << CreateElementWithCommandLineToolFiller::InOutData("in", CreateElementWithCommandLineToolFiller::InOutDataType(CreateElementWithCommandLineToolFiller::Sequence, "FASTA"));
2080 settings.command = "<My tool> $in";
2081 // GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "Continue"));
2082 GTUtilsDialog::waitForDialog(os, new CreateElementWithCommandLineToolFiller(os, settings));
2083 GTToolbar::clickButtonByTooltipOnToolbar(os, MWTOOLBAR_ACTIVEMDI, "Create element with external tool");
2084
2085 // 2) Right click at this worker on the palette -> Edit.
2086 // 3) Set a new name for the worker ("test1", for example).
2087 // 4) Next -> Next -> Next -> Finish.
2088 // 5) "Remove this element?" -> Cancel.
2089 settings.elementName = "test1";
2090 settings.input.clear();
2091 // GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Yes, "You have changed the structure of the element"));
2092 // GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, "Continue", "You don't use listed parameters in template string"));
2093 GTUtilsDialog::waitForDialog(os, new CreateElementWithCommandLineToolFiller(os, settings));
2094
2095 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Edit"));
2096
2097 GTUtilsWorkflowDesigner::setCurrentTab(os, GTUtilsWorkflowDesigner::algorithms);
2098 GTUtilsWorkflowDesigner::clickOnPalette(os, "test", Qt::RightButton);
2099 GTGlobals::sleep(5000); // added to ensure that crash is not here or to fix this crash
2100
2101 // Expected state: There are no custom workers on the palette now
2102 const QList<QTreeWidgetItem *> customElements = GTUtilsWorkflowDesigner::getPaletteGroupEntries(os, "Custom Elements with External Tools");
2103 CHECK_SET_ERR(customElementsCount + 1 == customElements.size(), QString("Unexpected custom elements count: expect %1, got %2").arg(customElementsCount + 1).arg(customElements.size()));
2104
2105 // 6) Click at the test worker on the palette
2106 // Expected state: UGENE not crashes.
2107 GTUtilsWorkflowDesigner::clickOnPalette(os, "test1");
2108 }
2109
GUI_TEST_CLASS_DEFINITION(test_0844)2110 GUI_TEST_CLASS_DEFINITION(test_0844) {
2111 /* 1. Open "samples/human_t1".
2112 * 2. In advanced settings of Tandem Finder choose "Suffix array" (unoptimized algorithm)
2113 * 3. Start finding tandems
2114 * Expected state: UGENE no crashes
2115 */
2116 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
2117 GTUtilsTaskTreeView::waitTaskFinished(os);
2118
2119 class Scenario : public CustomScenario {
2120 void run(HI::GUITestOpStatus &os) {
2121 QWidget *dialog = GTWidget::getActiveModalWidget(os);
2122 QComboBox *combo = qobject_cast<QComboBox *>(GTWidget::findWidget(os, "algoComboBox"));
2123 CHECK_SET_ERR(combo != nullptr, "algoComboBox not found!");
2124 GTComboBox::selectItemByText(os, combo, "Suffix array");
2125
2126 QLineEdit *pathEdit = qobject_cast<QLineEdit *>(GTWidget::findWidget(os, "leNewTablePath"));
2127 pathEdit->setText(sandBoxDir + "test_0844.gb");
2128 GTGlobals::sleep();
2129
2130 GTTabWidget::setCurrentIndex(os, GTWidget::findExactWidget<QTabWidget *>(os, "tabWidget"), 1);
2131
2132 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
2133 }
2134 };
2135
2136 GTUtilsDialog::waitForDialog(os, new FindTandemsDialogFiller(os, new Scenario));
2137 GTToolbar::clickButtonByTooltipOnToolbar(os, MWTOOLBAR_ACTIVEMDI, "Find tandem repeats");
2138 GTGlobals::sleep();
2139 GTUtilsTaskTreeView::waitTaskFinished(os);
2140 }
2141
GUI_TEST_CLASS_DEFINITION(test_0846)2142 GUI_TEST_CLASS_DEFINITION(test_0846) {
2143 // 1. Open "samples/human_t1".
2144 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
2145 GTUtilsTaskTreeView::waitTaskFinished(os);
2146
2147 // 2. Add any annotations;
2148 GTUtilsAnnotationsTreeView::createAnnotation(os, "", "", "1..100");
2149 GTUtilsTaskTreeView::waitTaskFinished(os);
2150
2151 // 3. Use popup menu {Export->Export annotations}
2152 // 4. Chose "csv" in combobox "File format"
2153 // 5. Click checkbox "Save sequence names"
2154 // 6. Click "OK"
2155 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Export"
2156 << "Export annotations...",
2157 GTGlobals::UseKey));
2158 GTUtilsDialog::waitForDialog(os, new ExportAnnotationsFiller(os, sandBoxDir + "test_0846.csv", ExportAnnotationsFiller::csv));
2159 GTUtilsSequenceView::openPopupMenuOnSequenceViewArea(os);
2160 GTUtilsTaskTreeView::waitTaskFinished(os);
2161
2162 GTGlobals::sleep();
2163 // Expected state: Annotations with sequence names were saved
2164 const QString data = GTFile::readAll(os, sandBoxDir + "test_0846.csv");
2165 const QString expectedSubstring = "human_T1 (UCSC April 2002 chr7:115977709-117855134)";
2166 CHECK_SET_ERR(data.contains(expectedSubstring), "Sequence name not found in the result file");
2167 }
2168
GUI_TEST_CLASS_DEFINITION(test_0854)2169 GUI_TEST_CLASS_DEFINITION(test_0854) {
2170 /* 1. Open samples/genbank/PBR322.gb.
2171 * 2. Export the sequence into alignment using context menu in project tab.
2172 * 3. Align it with MUSCLE.
2173 * Expected result: UGENE doesn't crash.
2174 */
2175 GTFileDialog::openFile(os, dataDir + "samples/Genbank/PBR322.gb");
2176 GTUtilsTaskTreeView::waitTaskFinished(os);
2177 GTUtilsTaskTreeView::waitTaskFinished(os);
2178
2179 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "PBR322.gb"));
2180 GTMouseDriver::click();
2181 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ACTION_PROJECT__EXPORT_IMPORT_MENU_ACTION << ACTION_EXPORT_SEQUENCE_AS_ALIGNMENT));
2182 GTUtilsDialog::waitForDialog(os, new ExportSequenceAsAlignmentFiller(os, sandBoxDir, "test_0854.aln", ExportSequenceAsAlignmentFiller::Clustalw, true));
2183 GTMouseDriver::click(Qt::RightButton);
2184 GTUtilsTaskTreeView::waitTaskFinished(os);
2185
2186 GTUtilsDialog::waitForDialog(os, new MuscleDialogFiller(os, MuscleDialogFiller::Default));
2187 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_ALIGN << "Align with muscle", GTGlobals::UseMouse));
2188 GTUtilsMSAEditorSequenceArea::moveTo(os, QPoint(0, 0));
2189 GTMouseDriver::click(Qt::RightButton);
2190 GTUtilsTaskTreeView::waitTaskFinished(os);
2191 }
2192
GUI_TEST_CLASS_DEFINITION(test_0858)2193 GUI_TEST_CLASS_DEFINITION(test_0858) {
2194 // 1. Open human_t1.fa
2195 // 2. Open the Statistics bar on the Options Panel
2196 // 3. Select and copy Characters Occurrence table
2197 // 4. Paste the table in a Text Editor
2198 // Expected state: the table in the editor and in the Options Panel have the same content
2199
2200 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
2201 GTUtilsTaskTreeView::waitTaskFinished(os);
2202 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::Statistics);
2203
2204 QLabel *label = GTWidget::findExactWidget<QLabel *>(os, "characters_occurrence_label");
2205
2206 QString expected = "<table cellspacing=5><tr><td><b>A: </td><td>62 842 </td><td>"
2207 "31.4% </td></tr><tr><td><b>C: </td><td>40 041 </td><td>20.0% "
2208 " </td></tr><tr><td><b>G: </td><td>37 622 </td><td>18.8% </td>"
2209 "</tr><tr><td><b>T: </td><td>59 445 </td><td>29.7% </td></tr></table>";
2210 QString got = label->text();
2211 CHECK_SET_ERR(got == expected, QString("The clipboard text is incorrect: [%1], expected [%2]").arg(got).arg(expected));
2212 }
2213
GUI_TEST_CLASS_DEFINITION(test_0861_1)2214 GUI_TEST_CLASS_DEFINITION(test_0861_1) {
2215 // 1. Open sars.gb
2216 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
2217 GTUtilsTaskTreeView::waitTaskFinished(os);
2218
2219 // 2. Open the "Annotations Highlighting" bar of the Options Panel
2220 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::AnnotationsHighlighting);
2221
2222 // Expected state : all annotation groups of sars.gb are in the "Annotation type" window:
2223 // 3'UTR, 5'UTR, CDS, comment, gene, mat_peptide, misc_feature, source
2224 QTreeWidget *highlightTree = GTWidget::findExactWidget<QTreeWidget *>(os, "OP_ANNOT_HIGHLIGHT_TREE");
2225 CHECK_SET_ERR(highlightTree->topLevelItemCount() == 8, "Unexpected number of annotations");
2226 CHECK_SET_ERR(highlightTree->topLevelItem(0)->text(0) == "3'UTR", QString("Unexpected annotation name at row %1").arg(0));
2227 CHECK_SET_ERR(highlightTree->topLevelItem(1)->text(0) == "5'UTR", QString("Unexpected annotation name at row %1").arg(1));
2228 CHECK_SET_ERR(highlightTree->topLevelItem(2)->text(0) == "CDS", QString("Unexpected annotation name at row %1").arg(2));
2229 CHECK_SET_ERR(highlightTree->topLevelItem(3)->text(0) == "comment", QString("Unexpected annotation name at row %1").arg(3));
2230 CHECK_SET_ERR(highlightTree->topLevelItem(4)->text(0) == "gene", QString("Unexpected annotation name at row %1").arg(4));
2231 CHECK_SET_ERR(highlightTree->topLevelItem(5)->text(0) == "mat_peptide", QString("Unexpected annotation name at row %1").arg(5));
2232 CHECK_SET_ERR(highlightTree->topLevelItem(6)->text(0) == "misc_feature", QString("Unexpected annotation name at row %1").arg(6));
2233 CHECK_SET_ERR(highlightTree->topLevelItem(7)->text(0) == "source", QString("Unexpected annotation name at row %1").arg(7));
2234 }
2235
GUI_TEST_CLASS_DEFINITION(test_0861_2)2236 GUI_TEST_CLASS_DEFINITION(test_0861_2) {
2237 // 1. Open sars.gb
2238 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
2239 GTUtilsTaskTreeView::waitTaskFinished(os);
2240
2241 // 2. Open the "Annotations Highlighting" bar of the Options Panel
2242 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::AnnotationsHighlighting);
2243 QTreeWidget *highlightTree = GTWidget::findExactWidget<QTreeWidget *>(os, "OP_ANNOT_HIGHLIGHT_TREE");
2244 CHECK_SET_ERR(highlightTree->topLevelItemCount() == 8, QString("Unexpected number of annotations: %1").arg(highlightTree->topLevelItemCount()));
2245
2246 // 3. Switch on ORFs auto annotation
2247 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Show ORFs"));
2248 GTWidget::click(os, GTWidget::findWidget(os, "toggleAutoAnnotationsButton"));
2249 GTUtilsTaskTreeView::waitTaskFinished(os);
2250
2251 // Expected : "ORF" annotation appeared in the "Annotation type" window
2252 CHECK_SET_ERR(highlightTree->topLevelItemCount() == 9, QString("Unexpected number of annotations: %1").arg(highlightTree->topLevelItemCount()));
2253 CHECK_SET_ERR(highlightTree->topLevelItem(7)->text(0) == "orf", QString("Unexpected annotation name at row %1").arg(7));
2254 }
2255
GUI_TEST_CLASS_DEFINITION(test_0861_3)2256 GUI_TEST_CLASS_DEFINITION(test_0861_3) {
2257 // 1. Open sars.gb
2258 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
2259 GTUtilsTaskTreeView::waitTaskFinished(os);
2260
2261 // 2. Open the "Annotations Highlighting" bar of the Options Panel
2262 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::AnnotationsHighlighting);
2263 QTreeWidget *highlightTree = GTWidget::findExactWidget<QTreeWidget *>(os, "OP_ANNOT_HIGHLIGHT_TREE");
2264 CHECK_SET_ERR(highlightTree->topLevelItemCount() == 8, "Unexpected number of annotations");
2265
2266 // 3. Remove 3'UTR annotation group.
2267 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "3'UTR (0, 1)"));
2268 GTMouseDriver::click();
2269 GTKeyboardDriver::keyClick(Qt::Key_Delete);
2270 GTGlobals::sleep(100);
2271
2272 // Expected state : 3'UTR group disapeared from "Annotation type" window
2273 CHECK_SET_ERR(highlightTree->topLevelItemCount() == 7, "Unexpected number of annotations");
2274 CHECK_SET_ERR(highlightTree->topLevelItem(0)->text(0) == "5'UTR", QString("Unexpected annotation name at row %1").arg(0));
2275 }
2276
GUI_TEST_CLASS_DEFINITION(test_0861_4)2277 GUI_TEST_CLASS_DEFINITION(test_0861_4) {
2278 // 1. Open human_t1.fa
2279 // 2. Open the "Annotations Highlighting" bar of the Options Panel
2280 // Expected state: the message "The sequence doesn't have any annotations." is shown on the bar
2281
2282 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
2283 GTUtilsTaskTreeView::waitTaskFinished(os);
2284 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::AnnotationsHighlighting);
2285 GTGlobals::sleep(500);
2286 QLabel *noAnnotTypesLabel = GTWidget::findExactWidget<QLabel *>(os, "noAnnotTypesLabel");
2287 CHECK_SET_ERR(noAnnotTypesLabel->isVisible(), "label is not visiable");
2288 CHECK_SET_ERR(noAnnotTypesLabel->text() == "The sequence doesn't have any annotations.",
2289 "unexpected text: " + noAnnotTypesLabel->text());
2290 }
2291
GUI_TEST_CLASS_DEFINITION(test_0861_5)2292 GUI_TEST_CLASS_DEFINITION(test_0861_5) {
2293 // 1. Open sars.gb
2294 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
2295 GTUtilsTaskTreeView::waitTaskFinished(os);
2296 // 2. Open the "Annotations Highlighting" bar of the Options Panel
2297 GTUtilsOptionPanelSequenceView::openTab(os, GTUtilsOptionPanelSequenceView::AnnotationsHighlighting);
2298 QLineEdit *editQualifiers = GTWidget::findExactWidget<QLineEdit *>(os, "editQualifiers");
2299 GTLineEdit::setText(os, editQualifiers, "aaaaaaaaaaa aaaaaaaaaaaa");
2300 QString style = editQualifiers->styleSheet();
2301 CHECK_SET_ERR(style == "background-color: rgb(255, 152, 142);", "unexpected styleSheet: " + style);
2302 // 3. Enter something with an incorrect symbol (eg "space")
2303 // Expected state: the line editor is highlighted in red background-color: rgb(255, 152, 142);
2304 }
2305
GUI_TEST_CLASS_DEFINITION(test_0866)2306 GUI_TEST_CLASS_DEFINITION(test_0866) {
2307 // 1. Open WD
2308 // 2. Ad the following elements to the scheme: Read File URL(s), Write Plain Text 1, Write Plain Text 2
2309 // 3. Connect Read File URL(s) to both writers
2310 // Expected state: Read File URL(s) connected successfully
2311
2312 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2313
2314 WorkflowProcessItem *fileList = GTUtilsWorkflowDesigner::addElement(os, "Read File URL(s)");
2315 WorkflowProcessItem *writer1 = GTUtilsWorkflowDesigner::addElement(os, "Write Plain Text");
2316 GTUtilsWorkflowDesigner::addElement(os, "Write Plain Text");
2317
2318 GTUtilsWorkflowDesigner::connect(os, fileList, writer1);
2319 GTUtilsWorkflowDesigner::connect(os, fileList, GTUtilsWorkflowDesigner::getWorker(os, "Write Plain Text 1"));
2320 }
2321
GUI_TEST_CLASS_DEFINITION(test_0868)2322 GUI_TEST_CLASS_DEFINITION(test_0868) {
2323 // Open chrM in Assembly Browser.
2324 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "chrM.sorted.bam.ugenedb"));
2325 GTFileDialog::openFile(os, dataDir + "samples/Assembly", "chrM.sorted.bam");
2326 GTUtilsAssemblyBrowser::checkAssemblyBrowserWindowIsActive(os);
2327
2328 // Zoom in multiple times to enable panning.
2329 for (int i = 0; i < 12; i++) {
2330 GTUtilsAssemblyBrowser::zoomIn(os);
2331 }
2332
2333 // Add a bookmark and activate it to ensure that view is aligned.
2334 GTUtilsBookmarksTreeView::addBookmark(os, GTUtilsMdi::activeWindow(os)->objectName(), "bookmark");
2335 GTMouseDriver::moveTo(GTUtilsBookmarksTreeView::getItemCenter(os, "bookmark"));
2336 GTMouseDriver::doubleClick();
2337 GTUtilsTaskTreeView::waitTaskFinished(os); // Navigation starts a new task. Wait for it to finish.
2338
2339 // Take the screenshot.
2340 QWidget *readsArea = GTWidget::findWidget(os, "assembly_reads_area");
2341 GTWidget::click(os, readsArea); // Click on the center of render area to set a predefined hover state.
2342 QImage initialImage = GTWidget::getImage(os, readsArea);
2343
2344 // Navigate to any other region.
2345 GTKeyboardDriver::keyClick(Qt::Key_Home);
2346 GTUtilsTaskTreeView::waitTaskFinished(os); // Navigation starts a new task. Wait for it to finish.
2347
2348 // Activate the bookmark again.
2349 GTMouseDriver::moveTo(GTUtilsBookmarksTreeView::getItemCenter(os, "bookmark"));
2350 GTMouseDriver::doubleClick();
2351 GTUtilsTaskTreeView::waitTaskFinished(os); // Navigation starts a new task. Wait for it to finish.
2352
2353 // Expected state: the new view matches the initial.
2354 GTWidget::click(os, readsArea); // Click on the center of render area to set a predefined hover state.
2355 QImage currentImage = GTWidget::getImage(os, readsArea);
2356 CHECK_SET_ERR(currentImage == initialImage, "The current view does not match the initial.");
2357 }
2358
GUI_TEST_CLASS_DEFINITION(test_0871)2359 GUI_TEST_CLASS_DEFINITION(test_0871) {
2360 // 1. Open WD
2361 // 2. Create a scheme with the following elements: Read Sequence, Amino Translation, Write Sequence
2362 // 3. Put humant_t1.fa as an input sequence
2363 // 4. Run the scheme
2364 // Expected state: the sequences that correspond to 3 translations frames of human_t1 are created
2365
2366 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2367
2368 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
2369 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/FASTA/human_T1.fa");
2370
2371 WorkflowProcessItem *amino = GTUtilsWorkflowDesigner::addElement(os, "Amino Acid Translation", true);
2372 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Sequence");
2373 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir(sandBoxDir).absolutePath() + "/test_0871.fa", GTUtilsWorkflowDesigner::textValue);
2374 GTUtilsWorkflowDesigner::connect(os, read, amino);
2375 GTUtilsWorkflowDesigner::connect(os, amino, write);
2376 GTUtilsWorkflowDesigner::runWorkflow(os);
2377 GTUtilsTaskTreeView::waitTaskFinished(os);
2378 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Separate));
2379 GTUtilsDashboard::clickOutputFile(os, "test_0871.fa");
2380 GTUtilsTaskTreeView::waitTaskFinished(os);
2381 GTUtilsProjectTreeView::rename(os, "human_T1 (UCSC April 2002 chr7:115977709-117855134) Amino translation 0 direct", "0");
2382 GTUtilsProjectTreeView::rename(os, "human_T1 (UCSC April 2002 chr7:115977709-117855134) Amino translation 1 direct", "1");
2383 GTUtilsProjectTreeView::rename(os, "human_T1 (UCSC April 2002 chr7:115977709-117855134) Amino translation 2 direct", "2");
2384 }
2385
GUI_TEST_CLASS_DEFINITION(test_0873)2386 GUI_TEST_CLASS_DEFINITION(test_0873) {
2387 // 1. Open WD
2388 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2389
2390 GTUtilsWorkflowDesigner::addSample(os, "Merge sequences and shift corresponding annotations");
2391
2392 GTUtilsWorkflowDesigner::click(os, "Read Sequence");
2393 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Genbank/murine.gb");
2394 GTUtilsWorkflowDesigner::setDatasetInputFile(os, dataDir + "samples/Genbank/sars.gb");
2395
2396 // 3. fill all needed parameters and run schema
2397 GTUtilsWorkflowDesigner::runWorkflow(os);
2398 GTUtilsTaskTreeView::waitTaskFinished(os);
2399 // Expected state: there are more then 10 result files and they are grouped into sublists
2400
2401 QWidget *button = GTWidget::findButtonByText(os, "merged.fa", GTUtilsDashboard::getDashboard(os));
2402 GTWidget::click(os, button);
2403 GTThread::waitForMainThread();
2404
2405 GTUtilsSequenceView::checkSequenceViewWindowIsActive(os);
2406 int sequenceLength = GTUtilsSequenceView::getLengthOfSequence(os);
2407 CHECK_SET_ERR(sequenceLength == 35594, "Sequence length is " + QString::number(sequenceLength) + ", expected 35594");
2408 }
2409
GUI_TEST_CLASS_DEFINITION(test_0878)2410 GUI_TEST_CLASS_DEFINITION(test_0878) {
2411 // 1. Open several documents of any kind - sequence view, workflow designer, whatever.
2412 // 2. Activate any document except the #1 (as numbered in Window menu).
2413 // 3. Click on the Log button at bottom toolbar.
2414 // Expected state: Log view is opened, selected document is shown.
2415 // 4. Click on the Log button again.
2416 // Expected state: Log view is closed, selected document is active (not first).
2417
2418 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
2419 GTUtilsTaskTreeView::waitTaskFinished(os);
2420 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2421 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
2422 GTUtilsTaskTreeView::waitTaskFinished(os);
2423
2424 QWidget *win = GTUtilsMdi::activeWindow(os);
2425 CHECK_SET_ERR(win != nullptr, "Active window not found");
2426
2427 GTWidget::click(os, GTWidget::findWidget(os, "doc_lable_dock_log_view"));
2428 CHECK_SET_ERR(win == GTUtilsMdi::activeWindow(os), "Incorrect active window");
2429 GTWidget::click(os, GTWidget::findWidget(os, "doc_lable_dock_log_view"));
2430 CHECK_SET_ERR(win == GTUtilsMdi::activeWindow(os), "Incorrect active window");
2431 }
2432
GUI_TEST_CLASS_DEFINITION(test_0882)2433 GUI_TEST_CLASS_DEFINITION(test_0882) {
2434 // 1. Open "data/samples/FASTQ/eas.fastq".
2435 // 2. Choose the "Align reads to reference sequence" option in appearing "Sequence reading option" dialog.
2436 // 3. Click "Ok" and specify a reference sequence in the "Align short reads" dialog (Use UGENE genome aligner).
2437 // 4. Click "Start" button.
2438 // Expected result: The dialog disappears, a notification about alignment results appears.
2439 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Align));
2440 AlignShortReadsFiller::UgeneGenomeAlignerParams parameters(dataDir + "samples/FASTA/human_T1.fa", QStringList());
2441 GTUtilsDialog::waitForDialog(os, new AlignShortReadsFiller(os, ¶meters));
2442 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "can't be mapped"));
2443 GTUtilsProject::openFileExpectNoProject(os, dataDir + "samples/FASTQ/eas.fastq");
2444 GTUtilsTaskTreeView::waitTaskFinished(os);
2445 GTGlobals::sleep();
2446 }
2447
GUI_TEST_CLASS_DEFINITION(test_0886)2448 GUI_TEST_CLASS_DEFINITION(test_0886) {
2449 // 1. Open file "_common_data/fasta/Gene.fa" in UGENE as a separate sequence or as a multiple alignment.
2450 // Expected result: UGENE doesn't crash, there is a warning report about non-imported sequences.
2451
2452 // Check 'as a sequence' mode.
2453 GTLogTracer l1;
2454 GTUtilsNotifications::waitForNotification(os, false);
2455 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os));
2456 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/Gene.fa");
2457 GTUtilsTaskTreeView::waitTaskFinished(os);
2458
2459 QStringList errors = GTUtilsLog::getErrors(os, l1);
2460 CHECK_SET_ERR(errors.size() == 1, "Wrong errors count 1 != " + QString::number(errors.size()) + ", errors: " + errors.join(","));
2461
2462 // Cleanup.
2463 GTUtilsProjectTreeView::click(os, "Gene.fa");
2464 GTKeyboardDriver::keyClick(Qt::Key_Delete);
2465 GTUtilsTaskTreeView::waitTaskFinished(os);
2466
2467 // Check 'as an alignment' mode.
2468 GTLogTracer l2;
2469 GTUtilsNotifications::waitForNotification(os, false);
2470 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Join));
2471 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/Gene.fa");
2472 GTUtilsTaskTreeView::waitTaskFinished(os);
2473 errors = GTUtilsLog::getErrors(os, l2);
2474 CHECK_SET_ERR(errors.size() == 2, "Wrong errors count 2 != " + QString::number(errors.size()) + ", errors: " + errors.join(","));
2475 }
2476
GUI_TEST_CLASS_DEFINITION(test_0888)2477 GUI_TEST_CLASS_DEFINITION(test_0888) {
2478 // 1. Open WD sampel scheme "Convert seq/qual pair to Fastq"
2479 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2480 GTUtilsWorkflowDesigner::addSample(os, "Convert seq/qual pair to FASTQ");
2481 GTKeyboardDriver::keyClick(Qt::Key_Escape);
2482
2483 // 2. Press "save as" and save it to the valid location
2484 GTUtilsWorkflowDesigner::saveWorkflowAs(os, sandBoxDir + "test_0888.uwl", "test_0888");
2485 GTUtilsTaskTreeView::waitTaskFinished(os);
2486
2487 // 3. Press "save schema" 3 times
2488 for (int i = 0; i < 3; i++) {
2489 GTUtilsWorkflowDesigner::saveWorkflow(os);
2490 }
2491 GTUtilsTaskTreeView::waitTaskFinished(os);
2492
2493 // 4. Open saved schema in text editor
2494 // Expected state: only 8 first lines starts with '#'
2495 QFile file(sandBoxDir + "test_0888.uwl");
2496 file.open(QFile::ReadOnly);
2497 const QList<QByteArray> data = file.readAll().split('\n');
2498
2499 int count = 0;
2500 foreach (const QByteArray &line, data) {
2501 if (line.startsWith("#")) {
2502 count++;
2503 }
2504 }
2505
2506 CHECK_SET_ERR(8 == count, QString("Unexpected count of '#' symbols: expet %1, got %2").arg(8).arg(count));
2507 }
2508
GUI_TEST_CLASS_DEFINITION(test_0889)2509 GUI_TEST_CLASS_DEFINITION(test_0889) {
2510 // 64-bit OS supported only
2511 #ifdef Q_OS_WIN32
2512 return;
2513 #endif
2514
2515 // 1) Open RNA.fa
2516 // 2) Use context menu on sequence {Align->Align sequence to mRNA}
2517 // 3) Select any item
2518 // 4) Click "Create"
2519 //
2520 // Expected state: UGENE not crashed
2521 GTUtilsDialog::waitForDialog(os, new SequenceReadingModeSelectorDialogFiller(os, SequenceReadingModeSelectorDialogFiller::Merge));
2522 GTUtilsProject::openFile(os, testDir + "_common_data/fasta/RNA.fa");
2523 GTUtilsTaskTreeView::waitTaskFinished(os);
2524
2525 class OkClicker : public Filler {
2526 public:
2527 OkClicker(HI::GUITestOpStatus &_os)
2528 : Filler(_os, "CreateAnnotationDialog") {
2529 }
2530 virtual void run() {
2531 QWidget *w = QApplication::activeWindow();
2532 CHECK(nullptr != w, );
2533 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
2534 CHECK(nullptr != buttonBox, );
2535 QPushButton *button = buttonBox->button(QDialogButtonBox::Ok);
2536 CHECK(nullptr != button, );
2537 GTWidget::click(os, button);
2538 }
2539 };
2540
2541 GTUtilsDialog::waitForDialog(os, new OkClicker(os));
2542 GTUtilsDialog::waitForDialog(os, new ProjectTreeItemSelectorDialogFiller(os, "RNA.fa", "Sequence"));
2543 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "ADV_MENU_ALIGN"
2544 << "Align sequence to mRNA"));
2545 GTMenu::showContextMenu(os, GTUtilsMdi::activeWindow(os));
2546 }
2547
GUI_TEST_CLASS_DEFINITION(test_0896)2548 GUI_TEST_CLASS_DEFINITION(test_0896) {
2549 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2550 GTUtilsWorkflowDesigner::removeCmdlineWorkerFromPalette(os, "SAMtools");
2551
2552 GTFileDialogUtils *ob = new GTFileDialogUtils(os, testDir + "_common_data/scenarios/_regression/896/_input", "SAMtools.etc");
2553 GTGlobals::sleep();
2554 GTUtilsDialog::waitForDialog(os, ob);
2555 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new MessageBoxDialogFiller(os, QMessageBox::Discard));
2556
2557 QAbstractButton *button = GTAction::button(os, "AddElementWithCommandLineTool");
2558 GTWidget::click(os, button);
2559 GTUtilsMdi::click(os, GTGlobals::Close);
2560 GTGlobals::sleep(2000);
2561
2562 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/896/_input/url_out_in_exttool.uwl");
2563 GTUtilsTaskTreeView::waitTaskFinished(os);
2564 GTUtilsTaskTreeView::waitTaskFinished(os);
2565
2566 CreateElementWithCommandLineToolFiller::ElementWithCommandLineSettings settings;
2567 settings.tool = "SAMtools";
2568 settings.command = "%USUPP_SAMTOOLS% view -b -S -o '" + QDir(sandBoxDir).absolutePath() + "/test_0896out.bam' $sam";
2569 GTUtilsDialog::waitForDialog(os, new CreateElementWithCommandLineToolFiller(os, settings));
2570
2571 GTMouseDriver::moveTo(GTUtilsWorkflowDesigner::getItemCenter(os, "SAMtools"));
2572 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "editConfiguration"));
2573 GTMouseDriver::click();
2574 GTMouseDriver::click(Qt::RightButton);
2575 GTGlobals::sleep();
2576
2577 WorkflowProcessItem *samtools = GTUtilsWorkflowDesigner::getWorker(os, "SAMtools", true);
2578
2579 GTUtilsWorkflowDesigner::click(os, samtools);
2580 QTableWidget *table = GTUtilsWorkflowDesigner::getInputPortsTable(os, 0);
2581 GTUtilsWorkflowDesigner::setTableValue(os, "Plain text", "Source URL (by File List)", GTUtilsWorkflowDesigner::comboValue, table);
2582
2583 GTUtilsWorkflowDesigner::click(os, "File List");
2584 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/bowtie/pattern/e_coli_1000.sam");
2585
2586 GTUtilsWorkflowDesigner::runWorkflow(os);
2587 GTUtilsTaskTreeView::waitTaskFinished(os);
2588
2589 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "test_0896"));
2590 GTFileDialog::openFile(os, sandBoxDir, "test_0896out.bam");
2591 GTUtilsTaskTreeView::waitTaskFinished(os);
2592 GTGlobals::sleep();
2593 }
2594
GUI_TEST_CLASS_DEFINITION(test_0898)2595 GUI_TEST_CLASS_DEFINITION(test_0898) {
2596 // 1. Open _common_data/ugenedb/example_alignment.ugenedb
2597 GTFileDialog::openFile(os, testDir + "_common_data/ugenedb/example-alignment.ugenedb");
2598 GTUtilsTaskTreeView::waitTaskFinished(os);
2599 // 2. Zoom in until reads appear.
2600
2601 // 3. Try to find consensus above reads area.
2602 // Expected state: you found consensus.
2603 QWidget *consArea = GTWidget::findWidget(os, "Consensus area");
2604 CHECK_SET_ERR(consArea->isVisible(), "consensus area is not visiable");
2605 // 4. Open {Assembly Browser Settings} on options panel.
2606 GTWidget::click(os, GTWidget::findWidget(os, "OP_ASS_SETTINGS"));
2607 GTGlobals::sleep(500);
2608 // 5. Look for any algorithms in {Consensus algorithm} combobox (SAMtools, for example).
2609 QComboBox *consensusAlgorithmCombo = GTWidget::findExactWidget<QComboBox *>(os, "consensusAlgorithmCombo");
2610 // Expected state: there are some algorithms.
2611 GTComboBox::checkValuesPresence(os, consensusAlgorithmCombo, QStringList() << "SAMtools"
2612 << "Default");
2613 }
2614
GUI_TEST_CLASS_DEFINITION(test_0899)2615 GUI_TEST_CLASS_DEFINITION(test_0899) {
2616 // 1) Import data\samples\Assembly\chrM.sorted.bam
2617 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "chrM.sorted.bam.ugenedb"));
2618 GTFileDialog::openFile(os, dataDir + "samples/Assembly", "chrM.sorted.bam");
2619 GTUtilsTaskTreeView::waitTaskFinished(os);
2620 GTUtilsTaskTreeView::waitTaskFinished(os);
2621
2622 class Scenario : public CustomScenario {
2623 void run(HI::GUITestOpStatus &os) {
2624 QWidget *dialog = GTWidget::getActiveModalWidget(os);
2625 // Expected state:
2626 // 1) opened dialog have File formats: {FASTA, FASTQ, GFF, Genbank, Vector NTI sequence}
2627 QComboBox *documentFormatComboBox = GTWidget::findExactWidget<QComboBox *>(os, "documentFormatComboBox", dialog);
2628 QStringList comboList;
2629 comboList << "FASTA"
2630 << "FASTQ"
2631 << "GFF"
2632 << "GenBank"
2633 << "Vector NTI sequence";
2634 GTComboBox::checkValuesPresence(os, documentFormatComboBox, comboList);
2635
2636 // 2) region: {whole sequence, visible, custom}
2637 QComboBox *region_type_combo = GTWidget::findExactWidget<QComboBox *>(os, "region_type_combo", dialog);
2638 QStringList regionComboList;
2639 regionComboList << "Whole sequence"
2640 << "Visible"
2641 << "Custom region";
2642 GTComboBox::checkValuesPresence(os, region_type_combo, regionComboList);
2643
2644 GTComboBox::selectItemByText(os, documentFormatComboBox, "GenBank");
2645 GTComboBox::selectItemByText(os, region_type_combo, "Whole sequence");
2646
2647 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
2648 }
2649 };
2650 // Export consensus
2651 GTUtilsDialog::waitForDialog(os, new ExportConsensusDialogFiller(os, new Scenario()));
2652 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Export consensus..."));
2653 GTWidget::click(os, GTWidget::findWidget(os, "Consensus area"), Qt::RightButton);
2654 GTUtilsProjectTreeView::checkItem(os, "chrM_consensus.gb");
2655 }
2656
GUI_TEST_CLASS_DEFINITION(test_0908)2657 GUI_TEST_CLASS_DEFINITION(test_0908) {
2658 // 1) Open WD
2659 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2660
2661 GTUtilsWorkflowDesigner::removeCmdlineWorkerFromPalette(os, "test_0908");
2662
2663 // 2) Click "Create element with external tool"
2664 // 3) input name "test"
2665 // 4) input data : "in1" and "in2" of FASTA
2666 // 5) output data : "out1" of FASTA
2667 // 6) Execution string : "cmd /c copy $in1 $out1 | copy $in2 $out1"
2668 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils(os, testDir + "_common_data/scenarios/_regression/908/test_0908.etc"));
2669 GTWidget::click(os, GTAction::button(os, "AddElementWithCommandLineTool"));
2670
2671 // 7) Add input and output readers of FASTA
2672 GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
2673 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/fasta/AMINO.fa");
2674
2675 GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
2676 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/fasta/alphabet.fa");
2677
2678 WorkflowProcessItem *writer = GTUtilsWorkflowDesigner::addElement(os, "Write Sequence");
2679
2680 WorkflowProcessItem *cmdlineWorker = GTUtilsWorkflowDesigner::getWorker(os, "test_0908");
2681
2682 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence"), cmdlineWorker);
2683 GTUtilsWorkflowDesigner::connect(os, GTUtilsWorkflowDesigner::getWorker(os, "Read Sequence 1"), cmdlineWorker);
2684 GTUtilsWorkflowDesigner::connect(os, cmdlineWorker, writer);
2685
2686 // 8) Run schema
2687 // Expected state : UGENE not crashed
2688 GTUtilsWorkflowDesigner::runWorkflow(os);
2689 uiLog.trace("workflow has been ran");
2690 GTGlobals::sleep(5000);
2691 uiLog.trace("test is coming to an end");
2692 }
2693
GUI_TEST_CLASS_DEFINITION(test_0910)2694 GUI_TEST_CLASS_DEFINITION(test_0910) {
2695 // 1. Create a scheme with the "Read sequence" element and the "Write sequence element".
2696 // 2. Take a file with more then one sequence as an input for the "Read sequence" element.
2697 // 3. Set the "Accumulate objects" parameters to False
2698 // 4. Set the "Existing file" parameter to "Rename"
2699 // 5. Run the scheme
2700 // 6. The number of output files must be equal to the number of input sequences
2701
2702 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2703
2704 WorkflowProcessItem *read = GTUtilsWorkflowDesigner::addElement(os, "Read Sequence", true);
2705 GTUtilsWorkflowDesigner::setDatasetInputFile(os, testDir + "_common_data/fasta/multy_fa.fa");
2706
2707 WorkflowProcessItem *write = GTUtilsWorkflowDesigner::addElement(os, "Write Sequence");
2708 GTUtilsWorkflowDesigner::setParameter(os, "Accumulate objects", "False", GTUtilsWorkflowDesigner::comboValue);
2709 GTUtilsWorkflowDesigner::setParameter(os, "Existing file", "Rename", GTUtilsWorkflowDesigner::comboValue);
2710 GTUtilsWorkflowDesigner::setParameter(os, "Output file", QDir(sandBoxDir).absolutePath() + "/test_0910", GTUtilsWorkflowDesigner::textValue);
2711
2712 GTUtilsWorkflowDesigner::connect(os, read, write);
2713 GTUtilsWorkflowDesigner::runWorkflow(os);
2714 GTUtilsTaskTreeView::waitTaskFinished(os);
2715
2716 QDir dir(sandBoxDir);
2717 CHECK_SET_ERR(dir.entryList(QDir::Files).count() == 2, QString("Incorrect count of sequence files: got %1, expected 2").arg(dir.entryList(QDir::Files).count()));
2718 foreach (const QString &fileName, dir.entryList(QDir::Files)) {
2719 CHECK_SET_ERR(fileName.startsWith("test_0910"), "Incorrect result file");
2720 }
2721 }
2722
GUI_TEST_CLASS_DEFINITION(test_0928)2723 GUI_TEST_CLASS_DEFINITION(test_0928) {
2724 // 1. Open "samples/FASTA/human_T1.fa".
2725 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
2726 GTUtilsTaskTreeView::waitTaskFinished(os);
2727
2728 class OkClicker : public Filler {
2729 public:
2730 OkClicker(HI::GUITestOpStatus &_os)
2731 : Filler(_os, "ORFDialogBase") {
2732 }
2733 virtual void run() {
2734 QWidget *w = QApplication::activeWindow();
2735 CHECK(nullptr != w, );
2736 QDialogButtonBox *buttonBox = w->findChild<QDialogButtonBox *>(QString::fromUtf8("buttonBox"));
2737 CHECK(nullptr != buttonBox, );
2738 QPushButton *button = buttonBox->button(QDialogButtonBox::Ok);
2739 CHECK(nullptr != button, );
2740 GTWidget::click(os, button);
2741 }
2742 };
2743
2744 // 2. Click "Find ORFs" button on the sequence view toolbar.
2745 // Expected state: ORF dialog appears. UGENE does not crash.
2746 // 3. Click "Ok" button and wait for the end of the task.
2747 GTUtilsDialog::waitForDialog(os, new OkClicker(os));
2748 GTWidget::click(os, GTAction::button(os, "Find ORFs"));
2749 GTUtilsTaskTreeView::waitTaskFinished(os);
2750 GTGlobals::sleep();
2751
2752 // GTGlobals::sleep(20000);
2753
2754 // Expected state: 837 orfs are found.
2755 QTreeWidgetItem *item = GTUtilsAnnotationsTreeView::findItem(os, "orf (0, 837)");
2756 CHECK(nullptr != item, );
2757 CHECK_SET_ERR(item->childCount() == 837, QString("ORFs count mismatch. Expected: %1. Actual: %2").arg(837).arg(item->childCount()));
2758 }
2759
GUI_TEST_CLASS_DEFINITION(test_0930)2760 GUI_TEST_CLASS_DEFINITION(test_0930) {
2761 // 1. Open any *.bam file (e.g. "_common_data/bam/scerevisiae.bam").
2762
2763 class Scenario : public CustomScenario {
2764 void run(HI::GUITestOpStatus &os) {
2765 QWidget *dialog = GTWidget::getActiveModalWidget(os);
2766 // 2. Look at the first column in the table above "Source URL" label.
2767 // Expected state: you saw "Assembly name" in the colunms head.
2768
2769 QTableWidget *tableWidget = GTWidget::findExactWidget<QTableWidget *>(os, "tableWidget", dialog);
2770 QString header = tableWidget->horizontalHeaderItem(0)->text();
2771 CHECK_SET_ERR(header == "Assembly name", "unexpected header: " + header);
2772
2773 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
2774 }
2775 };
2776 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, new Scenario()));
2777 GTFileDialog::openFile(os, testDir + "_common_data/bam/scerevisiae.bam");
2778 GTUtilsTaskTreeView::waitTaskFinished(os);
2779 GTGlobals::sleep();
2780 // Expected state: the "Import BAM File" dialog appeared.
2781 }
2782
GUI_TEST_CLASS_DEFINITION(test_0934)2783 GUI_TEST_CLASS_DEFINITION(test_0934) {
2784 // 1. Open file: _common_data\regression\934\trim_fa.fa
2785 GTUtilsProject::openMultiSequenceFileAsMalignment(os, testDir + "_common_data/regression/934/trim_fa.fa");
2786
2787 // 2. Open "Export sequences into alignment" dialog
2788 // 3. Select CLUSTALW format. Expected state: warning that na,es will be cut is shown
2789 // 4. Select MSF format and export
2790 // Steps 2 - 4 are deprecated
2791
2792 // 5. Align sequences with CLUSTALW. Excpected state: after alignment names are the same as before
2793 const QStringList originalNames = GTUtilsMSAEditorSequenceArea::getNameList(os);
2794
2795 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Align"
2796 << "Align with ClustalW...",
2797 GTGlobals::UseMouse));
2798 GTUtilsDialog::waitForDialog(os, new ClustalWDialogFiller(os));
2799 GTUtilsMSAEditorSequenceArea::callContextMenu(os);
2800
2801 GTUtilsTaskTreeView::waitTaskFinished(os);
2802
2803 const QStringList resultNames = GTUtilsMSAEditorSequenceArea::getNameList(os);
2804 CHECK_SET_ERR(originalNames == resultNames, QString("Unexpected sequence names: expect '%1', got '%2'").arg(originalNames.join(", ")).arg(resultNames.join(", ")));
2805 }
2806
GUI_TEST_CLASS_DEFINITION(test_0935)2807 GUI_TEST_CLASS_DEFINITION(test_0935) {
2808 // 1. Start the Workflow Designer.
2809 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
2810 // Expected state: the Eorkflow Designeg opened.
2811
2812 // 2. Add to the scene three elements: any Data Reader (e.g. Read Alignment), any Data Writer(e.g. Write Alignment), any element with input and output (e.g. Find Repeats).
2813 GTUtilsWorkflowDesigner::addAlgorithm(os, "Read Alignment");
2814 GTUtilsWorkflowDesigner::addAlgorithm(os, "Write Alignment");
2815 GTUtilsWorkflowDesigner::addAlgorithm(os, "CD Search");
2816 // Expected state: three elements are presented on the scene.
2817
2818 // 3. For each element: select element, see to its properties.
2819 GTUtilsWorkflowDesigner::click(os, "Read Alignment");
2820 QGroupBox *out = GTWidget::findExactWidget<QGroupBox *>(os, "outputPortBox");
2821 CHECK_SET_ERR(out->title() == "Output data", "unexpected out box title: " + out->title());
2822
2823 GTUtilsWorkflowDesigner::click(os, "Write Alignment", QPoint(-20, -20));
2824 QGroupBox *in = GTWidget::findExactWidget<QGroupBox *>(os, "inputPortBox");
2825 CHECK_SET_ERR(in->title() == "Input data", "unexpected in box title: " + in->title());
2826
2827 GTUtilsWorkflowDesigner::click(os, "CD Search");
2828 in = GTWidget::findExactWidget<QGroupBox *>(os, "inputPortBox");
2829 CHECK_SET_ERR(in->title() == "Input data", "unexpected in box title: " + in->title());
2830 out = GTWidget::findExactWidget<QGroupBox *>(os, "outputPortBox");
2831 CHECK_SET_ERR(out->title() == "Output data", "unexpected out box title: " + out->title());
2832 // Expected state: if element hasn't the input port, there is no "Input data" section in properties.
2833 // if element hasn't the output port, there is no "Outpu data" section in propeties.
2834 }
2835
GUI_TEST_CLASS_DEFINITION(test_0938)2836 GUI_TEST_CLASS_DEFINITION(test_0938) {
2837 // 1. Open any file in assembly view.
2838 // 2. Browse options panel.
2839 // 3. Open "Navigation" tab.
2840 // Expected state: The tab contains "Enter position in assembly" edit field, "Go!" button and "Most Covered Regions".
2841
2842 GTUtilsDialog::waitForDialog(os, new ImportBAMFileFiller(os, sandBoxDir + "chrM.sorted.bam.ugenedb"));
2843 GTFileDialog::openFile(os, dataDir + "samples/Assembly", "chrM.sorted.bam");
2844 GTUtilsTaskTreeView::waitTaskFinished(os);
2845 GTUtilsTaskTreeView::waitTaskFinished(os);
2846 GTGlobals::sleep();
2847
2848 GTWidget::click(os, GTWidget::findWidget(os, "OP_ASS_NAVIGATION"));
2849 GTGlobals::sleep();
2850 GTWidget::click(os, GTWidget::findWidget(os, "OP_ASS_INFO"));
2851 GTGlobals::sleep();
2852 GTWidget::click(os, GTWidget::findWidget(os, "OP_ASS_SETTINGS"));
2853 GTGlobals::sleep();
2854 GTWidget::click(os, GTWidget::findWidget(os, "OP_ASS_NAVIGATION"));
2855 GTGlobals::sleep();
2856 QWidget *parent = GTWidget::findWidget(os, "OP_OPTIONS_WIDGET");
2857 CHECK_SET_ERR(GTWidget::findWidget(os, "go_to_pos_line_edit", parent) != nullptr, "go_to_pos_line_edit not found");
2858 CHECK_SET_ERR(GTWidget::findWidget(os, "Go!", parent) != nullptr, "Go! button not found");
2859 CHECK_SET_ERR(GTWidget::findWidget(os, "COVERED", parent) != nullptr, "Covered regions widget not found");
2860 }
2861
GUI_TEST_CLASS_DEFINITION(test_0940)2862 GUI_TEST_CLASS_DEFINITION(test_0940) {
2863 // 1. Open samples/CLUSTALW/COI.aln.
2864 // 2. Select any part of the alignment.
2865 // 3. Context menu of the selected part -> Export -> Save subalignment.
2866 // 4. Choose the same output file (samples/CLUSTALW/COI.aln) and press "Extract" button.
2867 // Expected state: UGENE does not crash.
2868
2869 GTFile::copy(os, dataDir + "samples/CLUSTALW/COI.aln", sandBoxDir + "test_0940.aln");
2870
2871 GTFileDialog::openFile(os, sandBoxDir, "test_0940.aln");
2872 GTUtilsTaskTreeView::waitTaskFinished(os);
2873 GTUtilsTaskTreeView::waitTaskFinished(os);
2874
2875 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EXPORT << "Save subalignment"));
2876 GTUtilsDialog::waitForDialog(os, new ExtractSelectedAsMSADialogFiller(os, sandBoxDir + "test_0940.aln", GTUtilsMSAEditorSequenceArea::getNameList(os)));
2877 GTMenu::showContextMenu(os, GTWidget::findWidget(os, "msa_editor_sequence_area"));
2878 }
2879
2880 namespace {
2881
getFileContent(const QString & path)2882 QString getFileContent(const QString &path) {
2883 QFile file(path);
2884 CHECK(file.open(QFile::ReadOnly), QString("Can not open file"));
2885 QTextStream fileReader(&file);
2886 return fileReader.readAll();
2887 }
2888
2889 } // namespace
2890
GUI_TEST_CLASS_DEFINITION(test_0941)2891 GUI_TEST_CLASS_DEFINITION(test_0941) {
2892 // 1. Open COI.aln
2893 // 2. Select the first sequence and choose {Edit->Replace slected row with reverse}. Expected state: The sequences is reversed
2894 // 3. Select the second sequence and choose {Edit->Replace slected row with complement}. Expected state: The sequences is complemented
2895 GTFileDialog::openFile(os, dataDir + "samples/CLUSTALW/", "COI.aln");
2896 GTUtilsTaskTreeView::waitTaskFinished(os);
2897 GTUtilsTaskTreeView::waitTaskFinished(os);
2898
2899 GTUtilsMSAEditorSequenceArea::selectSequence(os, "Phaneroptera_falcata");
2900 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EDIT << "replace_selected_rows_with_reverse"));
2901 GTMenu::showContextMenu(os, GTWidget::findWidget(os, "msa_editor_sequence_area"));
2902
2903 GTUtilsMSAEditorSequenceArea::selectSequence(os, "Isophya_altaica_EF540820");
2904 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EDIT << "replace_selected_rows_with_reverse-complement"));
2905 GTMenu::showContextMenu(os, GTWidget::findWidget(os, "msa_editor_sequence_area"));
2906
2907 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << MSAE_MENU_EXPORT << "Save subalignment"));
2908 GTUtilsDialog::waitForDialog(os, new ExtractSelectedAsMSADialogFiller(os, sandBoxDir + "test_0941.aln", GTUtilsMSAEditorSequenceArea::getNameList(os)));
2909 GTMenu::showContextMenu(os, GTWidget::findWidget(os, "msa_editor_sequence_area"));
2910 GTGlobals::sleep();
2911
2912 QString resFileContent = getFileContent(sandBoxDir + "test_0941.aln");
2913 QString testFileContent = getFileContent(testDir + "_common_data/scenarios/_regression/941/test_0941.aln");
2914 CHECK_SET_ERR(resFileContent == testFileContent, "Incorrect result file");
2915 }
2916
GUI_TEST_CLASS_DEFINITION(test_0947)2917 GUI_TEST_CLASS_DEFINITION(test_0947) {
2918 /* 1. Open "data/samples/ABIF/A01.abi".
2919 * 3. Open GC Content (%) graph
2920 * 2. Close chomatogram view
2921 * Expected state: GC Content (%) graph view resized
2922 */
2923 GTFileDialog::openFile(os, dataDir + "/samples/ABIF/", "A01.abi");
2924 GTUtilsTaskTreeView::waitTaskFinished(os);
2925 GTGlobals::sleep();
2926
2927 QWidget *sequenceWidget = GTWidget::findWidget(os, "ADV_single_sequence_widget_0");
2928 CHECK_SET_ERR(nullptr != sequenceWidget, "sequenceWidget is not present");
2929
2930 GTWidget::click(os, sequenceWidget);
2931
2932 QWidget *graphAction = GTWidget::findWidget(os, "GraphMenuAction", sequenceWidget, false);
2933 Runnable *chooser = new PopupChooser(os, QStringList() << "GC Content (%)");
2934 GTUtilsDialog::waitForDialog(os, chooser);
2935
2936 GTWidget::click(os, graphAction);
2937 GTGlobals::sleep();
2938
2939 QAbstractButton *zoomAction = GTAction::button(os, "action_zoom_in_A1#berezikov");
2940 CHECK_SET_ERR(nullptr != zoomAction, "zoomAction is not present");
2941
2942 for (int i = 0; i < 10; i++) {
2943 GTWidget::click(os, zoomAction);
2944 GTGlobals::sleep(100);
2945 }
2946 }
2947
GUI_TEST_CLASS_DEFINITION(test_0948)2948 GUI_TEST_CLASS_DEFINITION(test_0948) {
2949 // 1. Open "open file" dialog
2950 // 2. Select both files _common_data\scenarios\_regression\948\s1.fa and _common_data\scenarios\_regression\948\s2.fa
2951 // 3. Press "Open" and select "merge mode"
2952 // Expected state: warning messagebox about different alphabets has appeared, sequences not merged, but opened in different views
2953 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok));
2954
2955 GTSequenceReadingModeDialog::mode = GTSequenceReadingModeDialog::Merge;
2956 GTUtilsDialog::waitForDialog(os, new GTSequenceReadingModeDialogUtils(os));
2957 GTUtilsDialog::waitForDialog(os, new GTFileDialogUtils_list(os, testDir + "_common_data/scenarios/_regression/948/", QStringList() << "s1.fa"
2958 << "s2.fa"));
2959 GTMenu::clickMainMenuItem(os, QStringList() << "File"
2960 << "Open...");
2961
2962 GTUtilsTaskTreeView::waitTaskFinished(os);
2963 GTGlobals::sleep(500);
2964 }
2965
GUI_TEST_CLASS_DEFINITION(test_0952)2966 GUI_TEST_CLASS_DEFINITION(test_0952) {
2967 // 1. Start UGENE.
2968 // 2. Press "Ctrl+O" or "Open" button on the main toolbar.
2969 // Expected state: "Select files to open..." dialog appears.
2970 // 3. Explore to the folder "data/samples/Genbank", then choose "CVU55762.gb" and "murine.gb" using Ctrl key
2971 // and press "Open" button.
2972 // Expected state: "Multiple sequence reading mode" dialog appears.
2973 // 4. Set radio button "Merge sequence mode", set "New document name" if you need, then press "OK".
2974
2975 GTSequenceReadingModeDialog::mode = GTSequenceReadingModeDialog::Merge;
2976 GTUtilsDialog::waitForDialog(os, new GTSequenceReadingModeDialogUtils(os));
2977 GTFileDialog::openFileList(os, dataDir + "samples/Genbank/", QStringList() << "murine.gb"
2978 << "sars.gb");
2979
2980 // Expected state: New merged document appears in project view.
2981 // 5. Open the sequences from the third step in sequence view.
2982 // Expected state: all the annotations from both sequences were converted correctly to the merged document i.e. without
2983 // any shifts relatively to a start of sequence.
2984 GTUtilsAnnotationsTreeView::getItemCenter(os, "3'UTR");
2985 bool found = GTUtilsAnnotationsTreeView::findRegion(os, "3'UTR", U2Region(35232, 363));
2986 CHECK_SET_ERR(found, "Wrong annotations shifting");
2987 }
2988
GUI_TEST_CLASS_DEFINITION(test_0958)2989 GUI_TEST_CLASS_DEFINITION(test_0958) {
2990 // 1. Create *.csv file with the following content
2991 // "Name","Start","End","Length","Complementary","Gene","desc","property","prop1","prop2"
2992 // "test01","1","400","400","no","tEs01","unknown funtion","blablabla","",""
2993 // "test02","60108","71020","10913","yes","","","","kobietghiginua","addsomethinghere"
2994 // 2. Open data/samples/FASTA/human_T1.fa.
2995 // 3. In the project tree's context menu choose option "Import" > "Import annotations from CSV file".
2996 // 4. In appearing "Import annotations from CSV file" dialog specify the *.csv file you have created,
2997 // "Result file" in Genbank format. Then in "Results preview" field specify the desirable interpretations
2998 // for each column accordingly to the first row in the preview table.
2999 // 5. Press "Run".
3000 // Expected result: annotations have been imported to the sequence with correct locations and qualifiers.
3001
3002 QFile file(sandBoxDir + "test_0958.csv");
3003 file.open(QFile::WriteOnly);
3004 file.write("\"Name\",\"Start\",\"End\",\"Length\",\"Complementary\",\"Gene\",\"desc\",\"property\",\"prop1\",\"prop2\"\n"
3005 "\"test01\",\"1\",\"400\",\"400\",\"no\",\"tEs01\",\"unknown funtion\",\"blablabla\",\"\",\"\"\n"
3006 "\"test02\",\"60108\",\"71020\",\"110913\",\"yes\",\"\",\"\",\"\",\"kobietghiginua\",\"addsomethinghere\"\n");
3007 file.close();
3008
3009 GTFileDialog::openFile(os, dataDir + "samples/FASTA/human_T1.fa");
3010 GTUtilsTaskTreeView::waitTaskFinished(os);
3011
3012 ImportAnnotationsToCsvFiller::RoleParameters r;
3013 r << ImportAnnotationsToCsvFiller::RoleColumnParameter(0, new ImportAnnotationsToCsvFiller::NameParameter())
3014 << ImportAnnotationsToCsvFiller::RoleColumnParameter(1, new ImportAnnotationsToCsvFiller::StartParameter(false))
3015 << ImportAnnotationsToCsvFiller::RoleColumnParameter(2, new ImportAnnotationsToCsvFiller::EndParameter(true))
3016 << ImportAnnotationsToCsvFiller::RoleColumnParameter(3, new ImportAnnotationsToCsvFiller::LengthParameter())
3017 << ImportAnnotationsToCsvFiller::RoleColumnParameter(4, new ImportAnnotationsToCsvFiller::StrandMarkParameter(true, "yes"))
3018 << ImportAnnotationsToCsvFiller::RoleColumnParameter(5, new ImportAnnotationsToCsvFiller::QualifierParameter("Gene"))
3019 << ImportAnnotationsToCsvFiller::RoleColumnParameter(6, new ImportAnnotationsToCsvFiller::QualifierParameter("desc"))
3020 << ImportAnnotationsToCsvFiller::RoleColumnParameter(7, new ImportAnnotationsToCsvFiller::QualifierParameter("property"))
3021 << ImportAnnotationsToCsvFiller::RoleColumnParameter(8, new ImportAnnotationsToCsvFiller::QualifierParameter("prop1"))
3022 << ImportAnnotationsToCsvFiller::RoleColumnParameter(9, new ImportAnnotationsToCsvFiller::QualifierParameter("prop2"));
3023
3024 ImportAnnotationsToCsvFiller *filler = new ImportAnnotationsToCsvFiller(os, sandBoxDir + "test_0958.csv", sandBoxDir + "test_0958.gb", ImportAnnotationsToCsvFiller::Genbank, true, true, ",", 1, "#", false, true, "misc_feature", r);
3025 GTUtilsDialog::waitForDialog(os, filler);
3026 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "action_project__export_import_menu_action"
3027 << "import_annotations_from_CSV_file"));
3028 GTUtilsProjectTreeView::click(os, "human_T1.fa", Qt::RightButton);
3029 GTGlobals::sleep();
3030 GTUtilsAnnotationsTreeView::selectItems(os, QStringList() << "test01");
3031
3032 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::findItem(os, "test01") != nullptr, "Annotation item not found");
3033 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getAnnotationRegionString(os, "test01") == "1..400", "Annotation region was improted incorrectly")
3034 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "Gene", "test01") == "tEs01", "Qualifier Gene was improted incorrectly");
3035 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "desc", "test01") == "unknown funtion", "Qualifier desc was improted incorrectly");
3036 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "property", "test01") == "blablabla", "Qualifier property was improted incorrectly");
3037 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "prop1", "test01") == "", "Qualifier prop1 was improted incorrectly");
3038 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "prop2", "test01") == "", "Qualifier prop2 was improted incorrectly");
3039
3040 GTUtilsAnnotationsTreeView::selectItems(os, QStringList() << "test02");
3041 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::findItem(os, "test02") != nullptr, "Annotation item not found");
3042 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getAnnotationRegionString(os, "test02") == "complement(60108..71020)", "Annotation region was improted incorrectly")
3043 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "Gene", "test02") == "",
3044 QString("Qualifier Gene was improted incorrectly: got '%1', expected ''").arg(GTUtilsAnnotationsTreeView::getQualifierValue(os, "Gene", "test02")));
3045 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "desc", "test02") == "", "Qualifier desc was improted incorrectly");
3046 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "property", "test02") == "", "Qualifier property was improted incorrectly");
3047 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "prop1", "test02") == "kobietghiginua", "Qualifier prop1 was improted incorrectly");
3048 CHECK_SET_ERR(GTUtilsAnnotationsTreeView::getQualifierValue(os, "prop2", "test02") == "addsomethinghere", "Qualifier prop2 was improted incorrectly");
3049 }
3050
GUI_TEST_CLASS_DEFINITION(test_0965)3051 GUI_TEST_CLASS_DEFINITION(test_0965) {
3052 // 1. Open a few files supporting bookmarks.
3053 // Expected state: in "Bookmarks" area corresponding number of root bookmarks are created.
3054 GTFileDialog::openFile(os, dataDir + "samples/Genbank/sars.gb");
3055 GTUtilsTaskTreeView::waitTaskFinished(os);
3056 GTFileDialog::openFile(os, dataDir + "samples/Genbank/murine.gb");
3057 GTUtilsTaskTreeView::waitTaskFinished(os);
3058
3059 // 2. Create a few sub bookmarks for each view.
3060 GTUtilsBookmarksTreeView::addBookmark(os, GTUtilsMdi::activeWindow(os)->objectName(), "murine");
3061 GTMouseDriver::moveTo(GTUtilsBookmarksTreeView::getItemCenter(os, "NC_004718 [sars.gb]"));
3062 GTMouseDriver::doubleClick();
3063 GTUtilsBookmarksTreeView::addBookmark(os, GTUtilsMdi::activeWindow(os)->objectName(), "sars");
3064
3065 // 3. Press right mouse button on any bookmark connected with currently invisible view.
3066 // Expected state: "Add bookmark" action is disabled in appeared context menu.
3067 GTMouseDriver::moveTo(GTUtilsBookmarksTreeView::getItemCenter(os, "murine"));
3068 GTUtilsDialog::waitForDialog(os, new PopupChecker(os, QStringList(ACTION_ADD_BOOKMARK), PopupChecker::IsDisabled));
3069 GTMouseDriver::click(Qt::RightButton);
3070 }
3071
GUI_TEST_CLASS_DEFINITION(test_0967_1)3072 GUI_TEST_CLASS_DEFINITION(test_0967_1) {
3073 // 1. Open any document: Project View shown.
3074 // 2. Minimize and then restore the main window: Project View should stay visible.
3075 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3076 GTUtilsSequenceView::checkSequenceViewWindowIsActive(os);
3077 // Check that the project is visible.
3078 CHECK_SET_ERR(GTUtilsProjectTreeView::isVisible(os), "ProjectTreeView is not visible (check #1)");
3079
3080 QMainWindow *mainWindow = AppContext::getMainWindow()->getQMainWindow();
3081 GTMainWindow::minimizeMainWindow(os, mainWindow);
3082 GTMainWindow::maximizeMainWindow(os, mainWindow);
3083
3084 // Check that the project is still visible.
3085 CHECK_SET_ERR(GTUtilsProjectTreeView::isVisible(os), "ProjectTreeView is not visible (check #2)");
3086 }
3087
GUI_TEST_CLASS_DEFINITION(test_0967_2)3088 GUI_TEST_CLASS_DEFINITION(test_0967_2) {
3089 // 1. Open Log view: Log view shown.
3090 // 2. Minimize and then restore the main window: log view should be not hidden.
3091
3092 GTKeyboardDriver::keyClick('3', Qt::AltModifier);
3093 QWidget *logView = GTWidget::findWidget(os, "dock_log_view");
3094 CHECK_SET_ERR(logView->isVisible(), "Log View is not visible (check #1)");
3095
3096 QMainWindow *mainWindow = AppContext::getMainWindow()->getQMainWindow();
3097 GTMainWindow::minimizeMainWindow(os, mainWindow);
3098 GTMainWindow::maximizeMainWindow(os, mainWindow);
3099
3100 logView = GTWidget::findWidget(os, "dock_log_view");
3101 CHECK_SET_ERR(logView->isVisible(), "Log View is not visible (check #2)");
3102 }
3103
GUI_TEST_CLASS_DEFINITION(test_0967_3)3104 GUI_TEST_CLASS_DEFINITION(test_0967_3) {
3105 // 1. Open Tasks view: expected state: Tasks View shown.
3106 // 2. Minimize and then restore the main window: Tasks View should be not hidden.
3107
3108 GTKeyboardDriver::keyClick('2', Qt::AltModifier);
3109 QWidget *tasksView = GTWidget::findWidget(os, "taskViewTree");
3110 CHECK_SET_ERR(tasksView->isVisible(), "taskViewTree is not visible (check #1)");
3111
3112 QMainWindow *mainWindow = AppContext::getMainWindow()->getQMainWindow();
3113 GTMainWindow::minimizeMainWindow(os, mainWindow);
3114 GTMainWindow::maximizeMainWindow(os, mainWindow);
3115
3116 tasksView = GTWidget::findWidget(os, "taskViewTree");
3117 CHECK_SET_ERR(tasksView->isVisible(), "taskViewTree is not visible (check #2)");
3118 }
3119
GUI_TEST_CLASS_DEFINITION(test_0969)3120 GUI_TEST_CLASS_DEFINITION(test_0969) {
3121 // 1. Open any scheme file and do nothing with the opened scene (do not change).
3122 // 2. Click on 'Load scheme' or 'New scheme' button.
3123 // Expected state: WD don't asks to save the current scene
3124
3125 GTUtilsWorkflowDesigner::openWorkflowDesigner(os);
3126 GTUtilsWorkflowDesigner::addSample(os, "call variants");
3127 GTKeyboardDriver::keyClick(Qt::Key_Escape);
3128 GTWidget::click(os, GTAction::button(os, "New workflow action"));
3129 GTGlobals::sleep();
3130 }
3131
GUI_TEST_CLASS_DEFINITION(test_0970)3132 GUI_TEST_CLASS_DEFINITION(test_0970) {
3133 Q_UNUSED(os);
3134 // 1. Enable Auto Annotations. Open human_T1.fa
3135 // 2. Open context menu for the Auto annotation in annotation tree view
3136 // Expected state: "Disable 'annotation' highlighting" item not presents in menu
3137 }
3138
GUI_TEST_CLASS_DEFINITION(test_0981_1)3139 GUI_TEST_CLASS_DEFINITION(test_0981_1) {
3140 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3141 GTUtilsTaskTreeView::waitTaskFinished(os);
3142 GTUtilsTaskTreeView::waitTaskFinished(os);
3143
3144 GTGlobals::sleep();
3145 Runnable *filler1 = new InsertSequenceFiller(os,
3146 "qweqwea",
3147 InsertSequenceFiller::Resize,
3148 1,
3149 "",
3150 InsertSequenceFiller::FASTA,
3151 false,
3152 false,
3153 GTGlobals::UseMouse,
3154 true);
3155 GTUtilsDialog::waitForDialog(os, filler1);
3156 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
3157 << "Edit"
3158 << "Insert subsequence...",
3159 GTGlobals::UseKey);
3160 GTGlobals::sleep();
3161 }
3162
GUI_TEST_CLASS_DEFINITION(test_0981_2)3163 GUI_TEST_CLASS_DEFINITION(test_0981_2) {
3164 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3165 GTUtilsTaskTreeView::waitTaskFinished(os);
3166 GTUtilsTaskTreeView::waitTaskFinished(os);
3167
3168 GTUtilsDialog::waitForDialog(os, new SelectSequenceRegionDialogFiller(os, 1, 2));
3169 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << "Select"
3170 << "Sequence region"));
3171 GTWidget::click(os, GTUtilsSequenceView::getSeqWidgetByNumber(os)->getDetView(), Qt::RightButton);
3172 GTGlobals::sleep(1000);
3173
3174 GTGlobals::sleep();
3175 Runnable *filler1 = new ReplaceSubsequenceDialogFiller(os,
3176 "qweqwea");
3177 GTUtilsDialog::waitForDialog(os, filler1);
3178 GTUtilsDialog::waitForDialog(os, new PopupChooser(os, QStringList() << ADV_MENU_EDIT << ACTION_EDIT_REPLACE_SUBSEQUENCE, GTGlobals::UseMouse));
3179 GTWidget::click(os, GTUtilsSequenceView::getSeqWidgetByNumber(os)->getDetView(), Qt::RightButton);
3180 GTGlobals::sleep();
3181 }
3182
GUI_TEST_CLASS_DEFINITION(test_0986)3183 GUI_TEST_CLASS_DEFINITION(test_0986) {
3184 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3185 GTUtilsTaskTreeView::waitTaskFinished(os);
3186 GTGlobals::sleep(3000);
3187
3188 SmithWatermanDialogFiller *filler = new SmithWatermanDialogFiller(os);
3189 filler->button = SmithWatermanDialogFiller::Cancel;
3190 GTUtilsDialog::waitForDialog(os, filler);
3191
3192 GTGlobals::sleep(500);
3193 GTKeyboardDriver::keyPress(Qt::Key_Shift);
3194 GTKeyboardDriver::keyClick('f', Qt::ControlModifier);
3195 GTKeyboardDriver::keyRelease(Qt::Key_Shift);
3196 GTGlobals::sleep(3000);
3197
3198 GTGlobals::sleep(5000);
3199 }
3200
GUI_TEST_CLASS_DEFINITION(test_0986_1)3201 GUI_TEST_CLASS_DEFINITION(test_0986_1) {
3202 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3203 GTUtilsTaskTreeView::waitTaskFinished(os);
3204 GTGlobals::sleep(3000);
3205
3206 SmithWatermanDialogFiller *filler = new SmithWatermanDialogFiller(os);
3207 filler->button = SmithWatermanDialogFiller::Cancel;
3208 GTUtilsDialog::waitForDialog(os, filler);
3209
3210 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
3211 << "Analyze"
3212 << "Find pattern [Smith-Waterman]...",
3213 GTGlobals::UseMouse);
3214 GTGlobals::sleep(5000);
3215
3216 GTGlobals::sleep(5000);
3217 }
3218
GUI_TEST_CLASS_DEFINITION(test_0986_2)3219 GUI_TEST_CLASS_DEFINITION(test_0986_2) {
3220 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3221 GTUtilsTaskTreeView::waitTaskFinished(os);
3222 GTGlobals::sleep(3000);
3223
3224 GTRegionSelector::RegionSelectorSettings regionSelectorSettings(1, 2);
3225 GTUtilsDialog::waitForDialog(os, new SmithWatermanDialogFiller(os, "ATCG", regionSelectorSettings));
3226
3227 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
3228 << "Analyze"
3229 << "Find pattern [Smith-Waterman]...",
3230 GTGlobals::UseMouse);
3231 GTGlobals::sleep(5000);
3232
3233 GTGlobals::sleep(5000);
3234 }
3235
GUI_TEST_CLASS_DEFINITION(test_0986_3)3236 GUI_TEST_CLASS_DEFINITION(test_0986_3) {
3237 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3238 GTUtilsTaskTreeView::waitTaskFinished(os);
3239 GTGlobals::sleep(3000);
3240
3241 GTRegionSelector::RegionSelectorSettings regionSelectorSettings(1, 2);
3242 GTUtilsDialog::waitForDialog(os, new SmithWatermanDialogFiller(os, "ATCGAT", regionSelectorSettings));
3243
3244 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
3245 << "Analyze"
3246 << "Find pattern [Smith-Waterman]...",
3247 GTGlobals::UseMouse);
3248 GTGlobals::sleep(5000);
3249
3250 GTMouseDriver::moveTo(GTUtilsProjectTreeView::getItemCenter(os, "human_T1.fa"));
3251 GTMouseDriver::click();
3252 GTKeyboardDriver::keyClick(Qt::Key_Delete);
3253
3254 GTGlobals::sleep(5000);
3255 }
3256
GUI_TEST_CLASS_DEFINITION(test_0986_4)3257 GUI_TEST_CLASS_DEFINITION(test_0986_4) {
3258 GTFileDialog::openFile(os, dataDir + "samples/FASTA/", "human_T1.fa");
3259 GTUtilsTaskTreeView::waitTaskFinished(os);
3260 GTGlobals::sleep(3000);
3261
3262 GTRegionSelector::RegionSelectorSettings regionSelectorSettings(1, 2);
3263 GTUtilsDialog::waitForDialog(os, new SmithWatermanDialogFiller(os, "ATCGAT", regionSelectorSettings));
3264
3265 GTMenu::clickMainMenuItem(os, QStringList() << "Actions"
3266 << "Analyze"
3267 << "Find pattern [Smith-Waterman]...",
3268 GTGlobals::UseMouse);
3269 GTGlobals::sleep(5000);
3270
3271 GTUtilsMdi::click(os, GTGlobals::Close);
3272 GTGlobals::sleep(5000);
3273 }
3274
GUI_TEST_CLASS_DEFINITION(test_0994)3275 GUI_TEST_CLASS_DEFINITION(test_0994) {
3276 /* 1. _common_data/scenarios/regression/994/musMusc.gb
3277 * 2. Expand contigs_snp group.
3278 * 3. Call a tooltip of he first annotation in the group.
3279 * Expected state: UGENE not crashes
3280 */
3281 GTFileDialog::openFile(os, testDir + "_common_data/scenarios/_regression/994/", "musMusc.gb");
3282 GTUtilsTaskTreeView::waitTaskFinished(os);
3283 GTGlobals::sleep(1000);
3284 GTMouseDriver::moveTo(GTUtilsAnnotationsTreeView::getItemCenter(os, "106-c1_38ftp"));
3285 GTGlobals::sleep(1000);
3286 }
3287
GUI_TEST_CLASS_DEFINITION(test_0999_1)3288 GUI_TEST_CLASS_DEFINITION(test_0999_1) {
3289 // 1. Do menu {File->New document from text...}
3290 // Expected state: Create Document dialog has appear
3291
3292 class Scenario : public CustomScenario {
3293 public:
3294 void run(HI::GUITestOpStatus &os) {
3295 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3296 // 2. Fill next fields in this dialog
3297 // {Paste sequence here} - AAAAAD
3298 // {Custom settings} - checked
3299 // {Replace unknown symbols with} - z
3300 GTPlainTextEdit::setPlainText(os, GTWidget::findExactWidget<QPlainTextEdit *>(os, "sequenceEdit", dialog), "AAAAAD");
3301 GTGroupBox::setChecked(os, "groupBox", dialog);
3302 GTRadioButton::click(os, GTWidget::findExactWidget<QRadioButton *>(os, "replaceRB", dialog));
3303 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "symbolToReplaceEdit", dialog), "z");
3304
3305 // 3. Press Create button
3306 // Expected state: error message appears "Replace symbol belongs to selected alphabet"
3307 GTUtilsDialog::waitForDialog(os, new MessageBoxDialogFiller(os, QMessageBox::Ok, "Replace symbol is not belongs to selected alphabet"));
3308 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
3309
3310 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
3311 }
3312 };
3313
3314 GTUtilsDialog::waitForDialog(os, new CreateDocumentFiller(os, new Scenario));
3315 GTMenu::clickMainMenuItem(os, QStringList() << "File"
3316 << "New document from text...");
3317 }
3318
GUI_TEST_CLASS_DEFINITION(test_0999_2)3319 GUI_TEST_CLASS_DEFINITION(test_0999_2) {
3320 // 1. Do menu {File->New document from text...}
3321 // Expected state: Create Document dialog has appear
3322
3323 class Scenario : public CustomScenario {
3324 public:
3325 void run(HI::GUITestOpStatus &os) {
3326 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3327 // 2. Fill next fields in this dialog
3328 // {Paste sequence here} - AAAZZZZZZAAA
3329 // {Custom settings} - checked
3330 // {Replace unknown symbols with} - T
3331 // {Document Location} - %any valid filepath%
3332 GTPlainTextEdit::setPlainText(os, GTWidget::findExactWidget<QPlainTextEdit *>(os, "sequenceEdit", dialog), "AAAZZZZZZAAA");
3333 GTGroupBox::setChecked(os, GTWidget::findExactWidget<QGroupBox *>(os, "groupBox", dialog));
3334 GTRadioButton::click(os, GTWidget::findExactWidget<QRadioButton *>(os, "replaceRB", dialog));
3335 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "symbolToReplaceEdit", dialog), "T");
3336 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "filepathEdit", dialog), sandBoxDir + "test_0999_2.fa");
3337
3338 // 3. Press Create button
3339 // Expected state: sequence view with sequence "AAATTTTTTAAA" has opened
3340 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
3341 }
3342 };
3343
3344 GTUtilsDialog::waitForDialog(os, new CreateDocumentFiller(os, new Scenario));
3345 GTMenu::clickMainMenuItem(os, QStringList() << "File"
3346 << "New document from text...");
3347
3348 GTUtilsTaskTreeView::waitTaskFinished(os);
3349 GTUtilsMdi::findWindow(os, "test_0999_2 [test_0999_2.fa]");
3350 }
3351
GUI_TEST_CLASS_DEFINITION(test_1000)3352 GUI_TEST_CLASS_DEFINITION(test_1000) {
3353 // 1. Open "data/samples/3INS.PDB".
3354 GTFileDialog::openFile(os, dataDir + "samples/PDB/3INS.PDB");
3355 GTUtilsTaskTreeView::waitTaskFinished(os);
3356
3357 // 2. In the context menu of the first sequence in sequence view choose {Analize -> Predict secondary structure...}.
3358 // Expected state: "Secondary structure prediction" dialog is opened.
3359
3360 class Scenario : public CustomScenario {
3361 public:
3362 Scenario(const QString &algorithm)
3363 : CustomScenario(),
3364 algorithm(algorithm) {
3365 }
3366
3367 void run(HI::GUITestOpStatus &os) {
3368 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3369 GTComboBox::selectItemByText(os, GTWidget::findExactWidget<QComboBox *>(os, "algorithmComboBox", dialog), algorithm);
3370
3371 // 3. Fill fields "Range start" and "Range end" with values "1" and "2" respectively.
3372
3373 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "start_edit_line", dialog), "1");
3374 GTLineEdit::setText(os, GTWidget::findExactWidget<QLineEdit *>(os, "end_edit_line", dialog), "2");
3375
3376 // 4. Press "Start prediction".
3377 GTGlobals::sleep();
3378 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
3379 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
3380 GTGlobals::sleep(500);
3381 GTThread::waitForMainThread();
3382 }
3383
3384 private:
3385 const QString algorithm;
3386 };
3387
3388 class DodgeLicenceDialogScenario : public CustomScenario {
3389 public:
3390 DodgeLicenceDialogScenario(const QString &algorithm)
3391 : CustomScenario(),
3392 algorithm(algorithm) {
3393 }
3394
3395 void run(HI::GUITestOpStatus &os) {
3396 QWidget *dialog = GTWidget::getActiveModalWidget(os);
3397 GTUtilsDialog::waitForDialogWhichMayRunOrNot(os, new LicenseAgreementDialogFiller(os));
3398 GTComboBox::selectItemByText(os, GTWidget::findExactWidget<QComboBox *>(os, "algorithmComboBox", dialog), algorithm);
3399
3400 // 4. Press "Start prediction".
3401 GTGlobals::sleep();
3402 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Ok);
3403 GTGlobals::sleep();
3404 GTThread::waitForMainThread();
3405 GTUtilsDialog::clickButtonBox(os, dialog, QDialogButtonBox::Cancel);
3406 GTGlobals::sleep(500);
3407 GTThread::waitForMainThread();
3408 }
3409
3410 private:
3411 const QString algorithm;
3412 };
3413
3414 // Expected state: Error notification appears.
3415 GTLogTracer lt1;
3416 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Analyze"
3417 << "Predict secondary structure..."));
3418 GTUtilsDialog::waitForDialog(os, new PredictSecondaryStructureDialogFiller(os, new Scenario("GORIV")));
3419 // GTUtilsNotifications::waitForNotification(os, true, "'Secondary structure predict' task failed: The size of sequence is less then minimal allowed size (5 residues).");
3420 GTUtilsSequenceView::openPopupMenuOnSequenceViewArea(os);
3421
3422 GTGlobals::sleep();
3423 GTUtilsLog::checkContainsError(os, lt1, QString("Task {Secondary structure predict} finished with error: The size of sequence is less then minimal allowed size (5 residues)"));
3424
3425 // 5. Repeat steps 2, 3, then choose another algorithm in dialog.
3426 // 6. Press "Start prediction".
3427 // Expected state: Error notification appears.
3428 GTLogTracer lt2;
3429 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Analyze"
3430 << "Predict secondary structure..."));
3431 GTUtilsDialog::waitForDialog(os, new PredictSecondaryStructureDialogFiller(os, new DodgeLicenceDialogScenario("PsiPred")));
3432 GTUtilsSequenceView::openPopupMenuOnSequenceViewArea(os);
3433 GTGlobals::sleep();
3434
3435 GTUtilsDialog::waitForDialog(os, new PopupChooserByText(os, QStringList() << "Analyze"
3436 << "Predict secondary structure..."));
3437 GTUtilsDialog::waitForDialog(os, new PredictSecondaryStructureDialogFiller(os, new Scenario("PsiPred")));
3438 // GTUtilsNotifications::waitForNotification(os, true, "'Secondary structure predict' task failed: The size of sequence is less then minimal allowed size (5 residues).");
3439 GTUtilsSequenceView::openPopupMenuOnSequenceViewArea(os);
3440
3441 GTGlobals::sleep();
3442 GTUtilsLog::checkContainsError(os, lt2, QString("Task {Secondary structure predict} finished with error: The size of sequence is less then minimal allowed size (5 residues)"));
3443 }
3444
3445 } // namespace GUITest_regression_scenarios
3446
3447 } // namespace U2
3448