{"id":25776694,"url":"https://github.com/Umutayb/Pickleib","last_synced_at":"2025-02-27T06:06:50.780Z","repository":{"id":44846995,"uuid":"402893055","full_name":"Umutayb/pickleib","owner":"Umutayb","description":"Quickstart library for test automation projects capable of webUI, mobileUI, API, database, data layer \u0026 email tests.","archived":false,"fork":false,"pushed_at":"2024-05-22T12:49:47.000Z","size":838,"stargazers_count":9,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-22T13:58:32.132Z","etag":null,"topics":["api-testing-framework","appium","database-testing","java","maven","selenium","selenium-webdriver","test","test-automation"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Umutayb.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":"2021-09-03T20:42:20.000Z","updated_at":"2024-05-22T13:59:11.240Z","dependencies_parsed_at":"2023-12-20T12:42:58.828Z","dependency_job_id":"4124ee2e-8059-4f93-9f24-683aa5988bf9","html_url":"https://github.com/Umutayb/pickleib","commit_stats":null,"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umutayb%2Fpickleib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umutayb%2Fpickleib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umutayb%2Fpickleib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Umutayb%2Fpickleib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Umutayb","download_url":"https://codeload.github.com/Umutayb/pickleib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889334,"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":["api-testing-framework","appium","database-testing","java","maven","selenium","selenium-webdriver","test","test-automation"],"created_at":"2025-02-27T06:01:29.079Z","updated_at":"2025-02-27T06:06:50.773Z","avatar_url":"https://github.com/Umutayb.png","language":"Java","readme":"# Pickleib\n\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.umutayb/Pickleib?color=brightgreen\u0026label=Pickleib)](https://mvnrepository.com/artifact/io.github.umutayb/Pickleib/latest)\n\n### Description\n\nPickleib is a utility library for software automation projects. It helps you design and run tests with Selenium WebDriver in a simple and efficient way. It provides a set of utilities and ready to go driver setup that provide great convenience for designing test automations.\n\nSome features and benefits of using Pickleib are:\n* **Easy configuration**: You can set up your test environment with minimal code! Pickleib supports different browsers, drivers, timeouts, etc.\n* **Utilities**: Pickleib has various utilities that can help you interact with WebElements in a consistent/non-flaky way. Check basic interaction methods such as click, fill, scroll, or more advanced utilities like element state, element attribute verifications. Find these at `WebUtilities.java`\n* **Page Object Model**: Pickleib can be use the Page Object Model pattern to organize your web elements and actions in separate classes. Pickleib provides classes and methods to simplify this process.\n* **API support**: Pickleib has built in api capabilities that enable defining calls to endpoints, model request \u0026 response bodies as well as verifying response details, testing frontend interactions against backends\n* **Emails**: It has email capabilities that enable sending or receiving emails directly in the framework. This feature is further supported by utilities that acquire email HTML and test email design, content and structure using the web driver.\n* **Database**: Pickleib provides database connection capabilities with JDBC. Database utilities can be used to establish an SQL connection, pass queries and map the results.\n* **Data Layer**: Built in data layer desting capabilities allow verifying specific events or data stored in the data layer.\n\n### Installation\n\nTo use Pickleib in your Maven project, add the following dependency to your pom.xml file:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.umutayb\u003c/groupId\u003e\n    \u003cartifactId\u003ePickleib\u003c/artifactId\u003e\n    \u003cversion\u003e1.x.x\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAfter updating your project, the quickstart library is ready to use. \n___\n### Usage\n\nThe quickstart library consists of many utility methods and a ready to use web driver, database connection \u0026 api handling.\nIt is compatible with page object model design. The infrastructure allows easy initialization of elements by initializing them\nwithin a constructor inside the **WebUtilities** class. In order to initialize elements inside a page class, all it takes is\nto extend the **WebUtilities** class. This also extends the **Driver** class, allowing usage of driver inside page classes.\n\n#### Step 1: Create a pages package\nImplement page objects, add elements (use @FindBy annotation) \u0026 page methods. _**Remember** extending **WebUtilities** class, \n initializing all elements within the page class._\n\n````java\nimport utils.WebUtilities;\n\npublic class HomePage extends WebUtilities {...}\n```` \n\n#### Step 2: Create a steps package\nCreate page step classes, instantiate page classes, create step definitions \u0026 access page methods within these step \n definitions as:\n ````java\npublic class HomePageSteps {\n    \n    HomePage homePage = new HomePage();\n\n    @Given(\"Click category card named {}\")\n    public void clickCategoryCard(String cardName) {\n        homePage.clickCategoryCardNamed(cardName);\n    }\n }\n ````\n**Alternatively**, use the reflection steps found in **PickleibSteps** class.\n\u003e\n\u003eCreate an ObjectRepository class, instantiate all page objects in it;\n\u003e\n\u003e```java\n\u003epublic class ObjectRepository {\n\u003e\n\u003e    HomePage homePage = new HomePage();\n\u003e\n\u003e}\n\u003e```\n\u003eThen input a new instance of ObjectRepository object to PickleibSteps methods;\n\u003e```java\n\u003eimport steps.PickleibSteps;\n\u003eimport utils.driver.Driver;\n\u003e\n\u003epublic class CommonSteps extends PickleibSteps {\n\u003e    @Given(\"If present, click the {} on the {}\")\n\u003e    public void clickIfPresent(String buttonName, String pageName){\n\u003e        log.new Info(\"Clicking \" +\n\u003e                highlighted(BLUE, buttonName) +\n\u003e                highlighted(GRAY,\" on the \") +\n\u003e                highlighted(BLUE, pageName) +\n\u003e                highlighted(GRAY, \", if present...\")\n\u003e        );\n\u003e        pageName = strUtils.firstLetterDeCapped(pageName);\n\u003e        try {\n\u003e            WebElement element = getElementFromPage(buttonName, pageName, new ObjectRepository());\n\u003e            if (elementIs(element, ElementState.DISPLAYED)) clickElement(element, true);\n\u003e        }\n\u003e        catch (WebDriverException ignored){log.new Warning(\"The \" + buttonName + \" was not present\");}\n\u003e    }\n\u003e}    \n\u003e```\n\u003e\n\u003eIf using cucumber, set **@Before** \u0026 **@After** steps as:\n\u003e\n\u003e```java\n\u003eimport utils.driver.Driver;\n\u003e\n\u003epublic class CommonSteps {\n\u003e    @Before\n\u003e    public void start() {\n\u003e        Driver.initialize();\n\u003e    }\n\u003e\n\u003e    @After\n\u003e    public void kill(Scenario scenario) {\n\u003e        Driver.terminate();\n\u003e    }\n\u003e}    \n\u003e```\n\nUse your reflection step to interact with the element;\n```gherkin\n@TestEnv @Web-UI @SCN-Click-If-Present\nScenario: Test cookie accept button \n  * Navigate to the test page\n  * If present, click the cookieAcceptButton on the HomePage\n```\n\nSet up your test runner\n```java\n@RunWith(Cucumber.class)\n@CucumberOptions(\n        features = {\"src/test/java/features\"},\n        plugin = {\"json:target/reports/Cucumber.json\"},\n        glue = {\"steps\"},\n        publish = true\n)\npublic class TestRunner {\n\n    @BeforeClass\n    public static void initialSequence(){...}\n\n    @AfterClass\n    public static void finalSequence(){...}\n}\n```\n\n This will initialize the driver before each run, and kill it after each scenario is done. \n\n#### Execution\nIn order to execute a specific feature file on a given browser, use:\n```shell\nmvn clean test -q -Dcucumber.filter.tags=\"@TestEnv and @SCN-Click-If-Present\" -Dbrowser=chrome\n```\n\n###### It is recommended to use Pickleib as designed in **Web-Automation-Smaple-Cucumber** project\nTo create a cucumber project from scratch instead, run the following command in your command line:\n````shell\nmvn archetype:generate                      \\\n\"-DarchetypeGroupId=io.cucumber\"            \\\n\"-DarchetypeArtifactId=cucumber-archetype\"  \\\n\"-DarchetypeVersion=6.10.4\"                 \\\n\"-DgroupId=hellocucumber\"                   \\\n\"-DartifactId=hellocucumber\"                \\\n\"-Dpackage=hellocucumber\"                   \\\n\"-Dversion=1.0.0-SNAPSHOT\"                  \\\n\"-DinteractiveMode=false\"\n````\n##### Local tests:\n````shell\ndocker run -p 8080:8080 umutayb/vue-test-website\n````","funding_links":[],"categories":["测试"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUmutayb%2FPickleib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUmutayb%2FPickleib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUmutayb%2FPickleib/lists"}