{"id":15062230,"url":"https://github.com/clebert/pageobject","last_synced_at":"2025-10-04T22:31:09.805Z","repository":{"id":57134839,"uuid":"106959539","full_name":"clebert/pageobject","owner":"clebert","description":"A platform- and framework-independent UI test automation library.","archived":true,"fork":false,"pushed_at":"2018-05-16T04:17:47.000Z","size":5642,"stargazers_count":12,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T21:45:02.965Z","etag":null,"topics":["javascript","node","protractor","puppeteer","selenium","typescript","webdriver"],"latest_commit_sha":null,"homepage":"https://pageobject.js.org/","language":"TypeScript","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/clebert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-14T20:14:09.000Z","updated_at":"2023-12-19T17:41:17.000Z","dependencies_parsed_at":"2022-09-04T15:52:21.150Z","dependency_job_id":null,"html_url":"https://github.com/clebert/pageobject","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fpageobject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fpageobject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fpageobject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clebert%2Fpageobject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clebert","download_url":"https://codeload.github.com/clebert/pageobject/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235320974,"owners_count":18971223,"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":["javascript","node","protractor","puppeteer","selenium","typescript","webdriver"],"created_at":"2024-09-24T23:32:39.976Z","updated_at":"2025-10-04T22:31:03.739Z","avatar_url":"https://github.com/clebert.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PageObjectJS\n\n[![Build Status][badge-travis-image]][badge-travis-link]\n[![Coverage Status][badge-coveralls-image]][badge-coveralls-link]\n[![TypeScript][badge-typescript-image]][badge-typescript-link]\n\n\u003e A platform- and framework-independent UI test automation library.\n\n## Getting started\n\nYou can find the **complete code** of all examples [here](https://github.com/clebert/pageobject/blob/master/docs/examples/).\nTo run them, you need Node.js version 8 or higher.\n\n### Example 1: Writing your first automated web UI test\n\nIn this example we write a test which opens the website [example.com](http://example.com/) and asserts its page title:\n\n```js\nfunction example(test, app) {\n  test\n    .perform(app.page.goto('http://example.com/'))\n    .assert(app.page.getTitle(), is('Example Domain'));\n}\n```\n\nWe also need to write our first component, which currently serves only to give us access to its page object:\n\n```js\n// ES2015 notation\nclass App extends WebComponent {\n  get selector() {\n    return ':root';\n  }\n}\n```\n\n```js\n// TypeScript/Babel notation\nclass App extends WebComponent {\n  selector = ':root';\n}\n```\n\nThe test is performed in Node.js without a real browser using [jsdom][external-jsdom]:\n\n```js\nconst adapter = new JSDOMAdapter();\n\nawait Test.run(new App(adapter), 10, example);\n```\n\n### Example 2: Using a real browser\n\nTo use a real browser instead of jsdom, we have to choose another adapter.\n\nAdapters for the following test automation solutions are currently available:\n\n* [Puppeteer][internal-api-puppeteer]\n* [Selenium][internal-api-selenium-webdriver]\n* [Protractor][internal-api-protractor]\n\nWe only need to change one line to run the above test in a headless Chrome:\n\n```js\nconst adapter = await PuppeteerAdapter.create();\n```\n\n### Example 3: Writing and using another component\n\nNext we write a component for the \"more information\" link:\n\n```js\nclass Link extends WebComponent {\n  get selector() {\n    return 'a';\n  }\n}\n```\n\nWe declare the link as a descendant of the app component:\n\n```js\nclass App extends WebComponent {\n  get selector() {\n    return ':root';\n  }\n\n  get moreInformationLink() {\n    return new Link(this.adapter, this);\n  }\n}\n```\n\nNow we extend our existing test so that it asserts the link text and then clicks on the link:\n\n```js\nfunction example(test, app) {\n  test\n    .perform(app.page.goto('http://example.com/'))\n    .assert(app.page.getTitle(), is('Example Domain'))\n    .assert(app.moreInformationLink.getText(), is('More information...'))\n    .perform(app.moreInformationLink.click());\n}\n```\n\n## Further examples\n\n### [@pageobject/todomvc][internal-api-todomvc]\n\nAn exemplary test suite for the popular TodoMVC application.\n\n## Packages\n\n### [@pageobject/base][internal-api-base]\n\nA declarative API as a **basis** for platform- and framework-independent UI test automation.\n\n### [@pageobject/web][internal-api-web]\n\nA declarative API for framework-independent **web** UI test automation.\n\n### [@pageobject/protractor][internal-api-protractor]\n\nA web API adapter for Protractor.\n\n### [@pageobject/puppeteer][internal-api-puppeteer]\n\nA web API adapter for Puppeteer.\n\n### [@pageobject/selenium-webdriver][internal-api-selenium-webdriver]\n\nA web API adapter for Selenium.\n\n---\n\nCopyright (c) 2017-present, Clemens Akens. Released under the terms of the [MIT License][internal-license].\n\n[badge-coveralls-image]: https://coveralls.io/repos/github/clebert/pageobject/badge.svg?branch=master\n[badge-coveralls-link]: https://coveralls.io/github/clebert/pageobject?branch=master\n[badge-travis-image]: https://travis-ci.org/clebert/pageobject.svg?branch=master\n[badge-travis-link]: https://travis-ci.org/clebert/pageobject\n[badge-typescript-image]: https://img.shields.io/badge/TypeScript-ready-blue.svg\n[badge-typescript-link]: https://www.typescriptlang.org/\n[external-jsdom]: https://github.com/jsdom/jsdom\n[internal-api-base]: https://pageobject.js.org/api/base/\n[internal-api-protractor]: https://pageobject.js.org/api/protractor/\n[internal-api-puppeteer]: https://pageobject.js.org/api/puppeteer/\n[internal-api-selenium-webdriver]: https://pageobject.js.org/api/selenium-webdriver/\n[internal-api-todomvc]: https://pageobject.js.org/api/todomvc/\n[internal-api-web]: https://pageobject.js.org/api/web/\n[internal-license]: https://github.com/clebert/pageobject/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclebert%2Fpageobject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclebert%2Fpageobject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclebert%2Fpageobject/lists"}