Skip to content

Commit

Permalink
working TC
Browse files Browse the repository at this point in the history
  • Loading branch information
midays committed Oct 4, 2023
1 parent 3352239 commit fe5d23c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/models/IDE/Intellij.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ def cancel_analysis(self):
self.click_element(locator_type="image", locator="cancel_analysis.png")
self.click()

def open_plugin_info(self, plugin_name):
def open_plugin_info(self, plugin):
self.press_keys("ctrl", "alt", "s")
self.press_keys("ctrl", "f")
self.type_text("plugins")
self.press_keys("enter")
self.type_text(f"Migration Toolkit for {plugin_name}")
self.type_text(f"Migration Toolkit for {plugin}")
self.press_keys("enter")
20 changes: 14 additions & 6 deletions src/tests/intellij/test_miscellaneous_items.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
import os
import time

import pytest

from src.utils.ocr import find_all_sentence_occurrences

DATA_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + "/data/"

# Polarion TC:
# https://polarion.engineering.redhat.com/polarion/#/project/MigrationToolkitAppl/workitem?id=MTR-271


def test_plugin_info(setup_intellij):

plugin_short_name = "MTA" if pytest.mtr else "MTR"
plugin = "Applications" if pytest.mtr else "Runtimes"
"""
Test if the plugin panel shows the expected information
"""
intellij = setup_intellij
# Intellij freezes without this sleep
time.sleep(3)

intellij.open_mta_plugin_info()
intellij.open_plugin_info(plugin)

# assert all the following sentences are present in the panel
assert (
len(
find_all_sentence_occurrences(
"The Migration Toolkit for Applications (MTA) plugin for IntelliJ",
f"The Migration Toolkit for {plugin} ({plugin_short_name}) plugin for IntelliJ",
),
)
> 0
), (
'the sentence "The Migration '
"Toolkit for Applications (MTA) "
f"Toolkit for {plugin} ({plugin_short_name}) "
'plugin for IntelliJ" was not '
"found in the plugin info panel"
)
Expand Down Expand Up @@ -73,6 +81,6 @@ def test_plugin_info(setup_intellij):
'possible" was not found in the plugin '
"info panel"
)
assert len(find_all_sentence_occurrences("Read more about MTA here")) > 0, (
'the sentence "Read more about MTA here" was not found in the plugin info ' "panel"
)
assert (
len(find_all_sentence_occurrences("Read more about MTA here")) > 0
), 'the sentence "Read more about MTA here" was not found in the plugin info panel'

0 comments on commit fe5d23c

Please sign in to comment.