{"id":15527177,"url":"https://github.com/testmonkeys/maui","last_synced_at":"2025-04-23T12:16:39.118Z","repository":{"id":41835698,"uuid":"96290257","full_name":"TestMonkeys/maui","owner":"TestMonkeys","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-14T17:59:43.000Z","size":419,"stargazers_count":3,"open_issues_count":36,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T12:16:19.330Z","etag":null,"topics":["selenium","selenium-java","selenium-webdriver","test-automation","test-framework","testing-framework","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TestMonkeys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-05T07:30:47.000Z","updated_at":"2022-05-11T15:19:52.000Z","dependencies_parsed_at":"2025-03-05T12:42:07.938Z","dependency_job_id":null,"html_url":"https://github.com/TestMonkeys/maui","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TestMonkeys%2Fmaui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TestMonkeys%2Fmaui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TestMonkeys%2Fmaui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TestMonkeys%2Fmaui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TestMonkeys","download_url":"https://codeload.github.com/TestMonkeys/maui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250430600,"owners_count":21429324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["selenium","selenium-java","selenium-webdriver","test-automation","test-framework","testing-framework","wrapper"],"created_at":"2024-10-02T11:04:52.859Z","updated_at":"2025-04-23T12:16:39.090Z","avatar_url":"https://github.com/TestMonkeys.png","language":"Java","readme":"# MAUI \nmaui is a wrapper framework for Selenium Webdriver with the aim of providing an easier way of automating and executing tests.\nThe key features that maui offers are: Modularization and Element Type definition, as well as an automated retry mechanism for interacting with elements.\n\n# Quick Start\ncheck out the demo projects that are using maui: \n\n* [Test.Bash AutomationWeek Challenge](https://github.com/TestMonkeys/Test.Bash-Online---WebUi-Automation-Challenge---Intermediate)\n* [CafeTownSend Demo TAS](https://github.com/monofrei/cafetownsend-atf)\n\n# Features:\n## PageObjects Definition\nTo define a page object you must annotate your page class with a human readable name and a relative url, and add the elements that are found on the page\n```java\n...\nimport org.testmonkeys.maui.pageobjects.AbstractPage;\nimport org.testmonkeys.maui.pageobjects.ElementAccessor;\nimport org.testmonkeys.maui.pageobjects.PageAccessor;\nimport org.testmonkeys.maui.pageobjects.elements.Button;\nimport org.testmonkeys.maui.pageobjects.elements.Input;\n\n@Getter\n@PageAccessor(name = \"Landing Page\", url = \"/\")\npublic class LandingPage extends AbstractPage {\n\n    @ElementAccessor(elementName = \"Submit button\", byXPath = \"//div[@id='submitDiv']//button\")\n    private Button submit;\n    \n    @ElementAccessor(elementName = \"Username\", byId = \"username\")\n    private Input username;\n...\n```\nThe types available to use are: \n* Button\n* CheckBox\n* Hyperlink\n* Input\n* Label\n* RadioButton\n* Select\n\nAnd you can define your custom elements to extend the list or alter the interaction.\n\n## Retrieving the instance of a Page Object in your tests:\nTo get the instance of the page object you need to first initialize the Browser and PageFactory:\n```java\nWebDriver driver = new ChromeDriver();\nBrowser browser= new Browser(driver, TimeUnit.SECONDS, 10, 20);\nPageFactory pageFactory=new PageFactory(browser, new PageScanner(\"com.yourProject.pageObjects.package\"),\"https://yourTestedSiteHere.com\");\n```\nafter intialisation you can retrieve the pageOjbect objects either by class name or by their name defined in the page accessor:\n```java\nLandingPage page= pageFactory.createPage(LandingPage.class);\n```\nor \n```java\nLandingPage page= pageFactory.createPage(\"Landing Page\");\n```\n## Opening the page in the browser\n\nTo open a specific page in the browser you can use the open method, defined in the AbstractPage class, it will take the web site's url from page factory, add the relative url defined for the page and open that in browser:\n```java\npage.open();\n```\n\n## Interacting with page elements\n\nThe web elements have methods for the interactions that are possible with their type and can be used directly:\n```java\npage.getUsername().type(\"admin\");\nloginPage.getSubmit().click();\n```\n\n## Defining modules\nIf you have a set of elements that you want to group, either because they are repeated on multiple pages, or they are part of a list you can define them as a custom module:\n```java\npublic class MessageRow extends AbstractModule {\n\n    @ElementAccessor(elementName = \"Email\", byXPath = \".//div[1]/p\")\n    private Label email;\n\n    @ElementAccessor(elementName = \"Subject\", byXPath = \".//div[2]/p\")\n    private Label subject;\n\n    public void click() {\n        new ClickAction(subject).execute();\n    }\n\n}\n```\n\n## Working with Lists of elements\n\nTo define web element lists use GroupComponent\u003c\u003e class in your pageObject, annotate it with a standard @ElementAccessor, setting the locator that would find the elements in the list. This can be used with both web element components like inputs, labels or with custom defined modules:\n```java\n@PageAccessor(name = \"Messages Page\", url = \"/messages\")\npublic class MessagesPage extends AbstractPage {\n\n    @ElementAccessor(elementName = \"Messages\", byXPath = \"//div[@class='messages']//div[contains(@class,'row detail')]\")\n    private GroupComponent\u003cMessageRow\u003e messageList;\n```\nand in your tests you can get all the elements:\n```java\nList\u003cMessageRow\u003e messageElements= page.getMessageList().getAll();\n```\n\n# Compatibilities\nmaui is compatible with any java framework, and gives access to the underlying WebElement objects, it was also tested with BrowserStack\n\n\u003ca href=\"http://www.browserstack.com\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/TestMonkeys/maui/blob/browserStackIntegration/.browserStack/Browserstack-logo.svg\" \nalt=\"BrowserStack\" width=\"240\"  /\u003e\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestmonkeys%2Fmaui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestmonkeys%2Fmaui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestmonkeys%2Fmaui/lists"}