Perspective Automated Testing Tools

The libraries announced during ICC 2023 reside here: GitHub - inductiveautomation/ignition-automation-tools

Please note that these are a tool we are providing and are not an Ignition product. As such, questions regarding their use or issues encountered while using them are not something the Inductive Automation Support team will be able to assist you with. These questions or issues can either be raised directly in Pull Requests or message within GitHub, or posted here in the forums.

19 Likes

any chance we can also get your ICC 2023 session video?

2 Likes

There's several ways to get the information I covered during that session:

  1. Your ICC registration included access to livestream content. The livestreams were recorded and are still available using the same livestream link.
  2. The sessions eventually get added to the Session Archive. I've been told that usually happens at the end of the year or early the following year. I have no control or insight into this process, so I can't give you a better estimate into when it will happen.
  3. You can ask questions here (in a new thread). I try to stay active on the forums and will get back to you as soon as I can.
  4. I think I can share my slide deck within a message, but I'd need to talk to the ICC team and see if there's some legal reason it might be restricted/time-gated as part of ICC content.

The session has now been archived and is publicly available.

Edit: I forgot the archive link.
Additional edit: the session is now present in the archive.

5 Likes

Hi, is there any further information that can be referenced on how these tools can be implemented? Such as screenshots or videos of how the test looks, or a guide on how to set this up and do a simple test?

Your actual test is going to look different depending on which framework you use to manage the test cases. I can provide examples of how we use this content, but it requires use of Pytest to execute the tests. You should research the frameworks available to you, and then request help with that specific framework.

The basic idea is this:

  • Create a page object which contains initialization and getter/setter functions for all components you need to work with.
  • Create a test class which knows about only your page object.
  • Within test cases (functions), use functions of your page object to interact with your page by setting/getting values.

So you'll have pages like this (Pages/MyPage.py):

from selenium.webdriver.common.by import By

from Components.PerspectiveComponents.Displays.Label import Label
from Components.PerspectiveComponents.Inputs.Dropdown import Dropdown


class MyPage(PerspectivePageObject):
    def __init__(driver):
        super().__init__(driver=driver)
        _bay_dropdown = Dropdown(driver=driver, locator=(By.ID, "domIdFromMeta"))  # each Perspective component has a domId prop within META
        _header_label = Label(driver=driver, locator=(By.ID, "header_label"))

    def set_bay(self, bay_name: str):
        self._bay_dropdown.select_option_by_text_if_not_selected(option_text=bay_name)

    def get_bay_name_from_header_label(self):
        return self._header_label.get_text()

And tests like this (where you are responsible for starting the browser and providing the class a driver in some manner - this example will assume you've provided it as a class attribute: driver):

from Pages.MyPage import MyPage


class YourTestClass:
    TEST_BAY_NAME = "Bay 17"

    def __init__(self):
        # class setup (like page objects) here
        self.my_page_inst = MyPage(driver=self.driver)
        self.my_page_inst.navigate_to()  # As called out in the readme file, you'll need to provide your own navigation pattern.

    def test_dropdown_populates_bay_template_based_on_selection(self)
        assert self.my_page_inst.get_bay_name_from_header_label() != self.TEST_BAY_NAME, "Page in unexpected state to begin test."
        self.my_page_inst. set_bay(bay_name=self.TEST_BAY_NAME)
        assert self.my_page_inst.get_bay_name_from_header_label() == self.TEST_BAY_NAME, "Failed to use the Dropdown to select a bay to view.."