-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add enumerator/iteraterables to Locator #12336
Comments
something like
in |
pretty much, not sure about the exact technicalities like whether it should post or preincrement and whether it should use _frame._queryCount or the locator's built in count |
Isn't it already available? I think it was implemented with https://playwright.dev/docs/api/class-locator#locator-count I think this issue can be closed. What do you think @kapros ? |
Hi @jfgreffier, not really, the issue is about returning an enumerable / iterable object (so that you can use a foreach / forOf loop, the functions you linked allow you to iterate yourself with a standard for loop. Not like this is problematic, but on the other hand, just like mentioned, an iterable would allow using language builtins for working with lists/arrays and so on. |
I don't see this as necessary, as it can probably be done in the user land. Also, there are several ways to manipulate Locator lists https://playwright.dev/docs/locators#lists |
If you follow this mindset quite everything can be made in user land :/ |
As for me, iterables are important feature. it's not every-day feature, but i found quite useful this feature, since in my project - we are works with excel-like tables. All elements are divs, we need to iterate each of them and get each value separately and assert each of them. So my conclusion - this is a useful feature for tables and data-type representations in browser. In my project we define function which do the same as for |
This would make using |
A helper function for all Clojurists to (defn seq-locs
"Just remember to extract all of it before the locator changes"
([locator] (seq-locs locator 0))
([locator n] (lazy-seq (if (< n (.count locator))
(cons (.nth locator n) (seq-locs locator (inc n)))
'()
)))) |
In Python, not being able to natively enumerate, iterate on (collection[i]) or use locators in for-each loops makes the code seem really non-idiomatic and non-intuitive. Not being able to call
|
Already implemented enumerator in P.S. Im disappointed on playwright team, since when i was asking a question for "public roadmap". They was asking - "look at the tags for future version". See at #17409 . Okay, am look at the Github issues at 19 Dec 2022 16:30 GMT+4 API call[ { "url": "https://api.github.com/repos//issues/19543", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19543/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19543/comments", "events_url": "https://api.github.com/repos//issues/19543/events", "html_url": "/~https://github.com//issues/19543", "id": 1501667477, "node_id": "I_kwDODTssw85ZgaCV", "number": 19543, "title": "[BUG] Cannot install webkit deps on debian 11 linux arm64", "user": { "login": "tekumara", "id": 125105, "node_id": "MDQ6VXNlcjEyNTEwNQ==", "avatar_url": "/~https://avatars.githubusercontent.com/u/125105?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tekumara", "html_url": "/~https://github.com/tekumara", "followers_url": "https://api.github.com/users/tekumara/followers", "following_url": "https://api.github.com/users/tekumara/following{/other_user}", "gists_url": "https://api.github.com/users/tekumara/gists{/gist_id}", "starred_url": "https://api.github.com/users/tekumara/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tekumara/subscriptions", "organizations_url": "https://api.github.com/users/tekumara/orgs", "repos_url": "https://api.github.com/users/tekumara/repos", "events_url": "https://api.github.com/users/tekumara/events{/privacy}", "received_events_url": "https://api.github.com/users/tekumara/received_events", "type": "User", "site_admin": false }, "labels": [], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 3, "created_at": "2022-12-18T00:29:30Z", "updated_at": "2022-12-19T10:22:29Z", "closed_at": "2022-12-19T10:22:02Z", "author_association": "NONE", "active_lock_reason": null, "body": "I'm using python:3.9 debian bullseye on arm64:\r\n\r\n```\r\n❯ docker run --rm -it --entrypoint /bin/bash python:3.9 -c \"pip install playwright && playwright install webkit --with-deps\"\r\nCollecting playwright\r\n Downloading playwright-1.28.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (32.9 MB)\r\n ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 32.9/32.9 MB 5.9 MB/s eta 0:00:00\r\nCollecting greenlet==2.0.1\r\n Downloading greenlet-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (526 kB)\r\n ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 526.1/526.1 KB 7.1 MB/s eta 0:00:00\r\nCollecting pyee==9.0.4\r\n Downloading pyee-9.0.4-py2.py3-none-any.whl (14 kB)\r\nCollecting typing-extensions\r\n Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)\r\nInstalling collected packages: typing-extensions, greenlet, pyee, playwright\r\nSuccessfully installed greenlet-2.0.1 playwright-1.28.0 pyee-9.0.4 typing-extensions-4.4.0\r\nWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\r\nWARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.\r\nYou should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.\r\nBEWARE: your OS is not officially supported by Playwright; installing dependencies for Ubuntu as a fallback.\r\nInstalling dependencies...\r\nGet:1 http://deb.debian.org/debian bullseye InRelease [116 kB]\r\nGet:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]\r\nGet:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]\r\nGet:4 http://deb.debian.org/debian bullseye/main arm64 Packages [8072 kB]\r\nGet:5 http://deb.debian.org/debian-security bullseye-security/main arm64 Packages [206 kB]\r\nGet:6 http://deb.debian.org/debian bullseye-updates/main arm64 Packages [12.0 kB]\r\nFetched 8498 kB in 2s (3407 kB/s) \r\nReading package lists... Done\r\nReading package lists... Done\r\nBuilding dependency tree... Done\r\nReading state information... Done\r\nNote, selecting 'libfontconfig1' instead of 'libfontconfig'\r\nPackage ttf-ubuntu-font-family is not available, but is referred to by another package.\r\nThis may mean that the package is missing, has been obsoleted, or\r\nis only available from another source\r\n\r\nPackage libjpeg-turbo8 is not available, but is referred to by another package.\r\nThis may mean that the package is missing, has been obsoleted, or\r\nis only available from another source\r\n\r\nE: Unable to locate package libenchant1c2a\r\nE: Unable to locate package libicu66\r\nE: Package 'libjpeg-turbo8' has no installation candidate\r\nE: Package 'ttf-ubuntu-font-family' has no installation candidate\r\nFailed to install browsers\r\nError: Installation process exited with code: 100\r\n```", "reactions": { "url": "https://api.github.com/repos//issues/19543/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19543/timeline", "performed_via_github_app": null, "state_reason": "completed" }, { "url": "https://api.github.com/repos//issues/19536", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19536/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19536/comments", "events_url": "https://api.github.com/repos//issues/19536/events", "html_url": "/~https://github.com//issues/19536", "id": 1501016242, "node_id": "I_kwDODTssw85Zd7Cy", "number": 19536, "title": "[Question] Equivalents of jest.fn() and jest.spyOn() in Playwright?", "user": { "login": "caleb531", "id": 872474, "node_id": "MDQ6VXNlcjg3MjQ3NA==", "avatar_url": "/~https://avatars.githubusercontent.com/u/872474?v=4", "gravatar_id": "", "url": "https://api.github.com/users/caleb531", "html_url": "/~https://github.com/caleb531", "followers_url": "https://api.github.com/users/caleb531/followers", "following_url": "https://api.github.com/users/caleb531/following{/other_user}", "gists_url": "https://api.github.com/users/caleb531/gists{/gist_id}", "starred_url": "https://api.github.com/users/caleb531/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/caleb531/subscriptions", "organizations_url": "https://api.github.com/users/caleb531/orgs", "repos_url": "https://api.github.com/users/caleb531/repos", "events_url": "https://api.github.com/users/caleb531/events{/privacy}", "received_events_url": "https://api.github.com/users/caleb531/received_events", "type": "User", "site_admin": false }, "labels": [ { "id": 2518858583, "node_id": "MDU6TGFiZWwyNTE4ODU4NTgz", "url": "https://api.github.com/repos/microsoft/playwright/labels/triaging", "name": "triaging", "color": "666666", "default": false, "description": "" } ], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 2, "created_at": "2022-12-16T23:43:13Z", "updated_at": "2022-12-17T00:25:35Z", "closed_at": "2022-12-17T00:25:35Z", "author_association": "NONE", "active_lock_reason": null, "body": "Hi,\r\n\r\nI have written integration-style tests before using Jest, where I made use of `jest.fn()` and `jest.spyOn()` to check if certain methods have been called, for example:\r\n\r\n```ts\r\njest.spyOn(supabase.auth.signIn).mockImplementation(async () => {\r\n return { authenticated: true };\r\n});\r\n// ...\r\nexpect(supabase.auth.signIn).toHaveBeenCalledWith({\r\n email: 'me@example.com',\r\n password: '12345' // just for testing; don't ever use a password like this\r\n});\r\n```\r\n\r\nHowever, I have really struggled to find equivalents in Playwright. The closest thing I could find was [the documentation on Mock APIs](https://playwright.dev/docs/mock), but that's not quite the same thing because I may need to disable behavior (e.g. overriding `window.location.reload()` to be a no-op).\r\n\r\nTo work around this, I am currently using the sinon package, but it's not my favorite because I have to create many custom matchers (e.g. `toHaveBeenCalled`, `toHaveBeenCalledOnce`, etc.) to achieve the desired readability (as opposed to something like `expect(stub.calledWith(1, 2, 3)).toBe(true)`.\r\n\r\nSo, are there equivalents to `jest.fn()` and `jest.spyOn()` in Playwright? If not, why is that?\r\n\r\nThanks in advance!\r\nCaleb\r\n", "reactions": { "url": "https://api.github.com/repos//issues/19536/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19536/timeline", "performed_via_github_app": null, "state_reason": "completed" }, { "url": "https://api.github.com/repos//issues/19533", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19533/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19533/comments", "events_url": "https://api.github.com/repos//issues/19533/events", "html_url": "/~https://github.com//pull/19533", "id": 1500740942, "node_id": "PR_kwDODTssw85Fq0Gz", "number": 19533, "title": "cherry-pick(#19532): docs: remove Serializable from Route.*.postData in java", "user": { "login": "yury-s", "id": 9798949, "node_id": "MDQ6VXNlcjk3OTg5NDk=", "avatar_url": "/~https://avatars.githubusercontent.com/u/9798949?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yury-s", "html_url": "/~https://github.com/yury-s", "followers_url": "https://api.github.com/users/yury-s/followers", "following_url": "https://api.github.com/users/yury-s/following{/other_user}", "gists_url": "https://api.github.com/users/yury-s/gists{/gist_id}", "starred_url": "https://api.github.com/users/yury-s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yury-s/subscriptions", "organizations_url": "https://api.github.com/users/yury-s/orgs", "repos_url": "https://api.github.com/users/yury-s/repos", "events_url": "https://api.github.com/users/yury-s/events{/privacy}", "received_events_url": "https://api.github.com/users/yury-s/received_events", "type": "User", "site_admin": false }, "labels": [], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 0, "created_at": "2022-12-16T19:17:33Z", "updated_at": "2022-12-16T19:21:53Z", "closed_at": "2022-12-16T19:21:52Z", "author_association": "MEMBER", "active_lock_reason": null, "draft": false, "pull_request": { "url": "https://api.github.com/repos/microsoft/playwright/pulls/19533", "html_url": "/~https://github.com//pull/19533", "diff_url": "/~https://github.com//pull/19533.diff", "patch_url": "/~https://github.com//pull/19533.patch", "merged_at": "2022-12-16T19:21:52Z" }, "body": null, "reactions": { "url": "https://api.github.com/repos//issues/19533/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19533/timeline", "performed_via_github_app": null, "state_reason": null }, { "url": "https://api.github.com/repos//issues/19532", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19532/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19532/comments", "events_url": "https://api.github.com/repos//issues/19532/events", "html_url": "/~https://github.com//pull/19532", "id": 1500705616, "node_id": "PR_kwDODTssw85Fqscr", "number": 19532, "title": "docs: remove Serializable from Route.*.postData in java", "user": { "login": "yury-s", "id": 9798949, "node_id": "MDQ6VXNlcjk3OTg5NDk=", "avatar_url": "/~https://avatars.githubusercontent.com/u/9798949?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yury-s", "html_url": "/~https://github.com/yury-s", "followers_url": "https://api.github.com/users/yury-s/followers", "following_url": "https://api.github.com/users/yury-s/following{/other_user}", "gists_url": "https://api.github.com/users/yury-s/gists{/gist_id}", "starred_url": "https://api.github.com/users/yury-s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yury-s/subscriptions", "organizations_url": "https://api.github.com/users/yury-s/orgs", "repos_url": "https://api.github.com/users/yury-s/repos", "events_url": "https://api.github.com/users/yury-s/events{/privacy}", "received_events_url": "https://api.github.com/users/yury-s/received_events", "type": "User", "site_admin": false }, "labels": [], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 0, "created_at": "2022-12-16T18:50:08Z", "updated_at": "2022-12-16T19:14:30Z", "closed_at": "2022-12-16T19:14:30Z", "author_association": "MEMBER", "active_lock_reason": null, "draft": false, "pull_request": { "url": "https://api.github.com/repos/microsoft/playwright/pulls/19532", "html_url": "/~https://github.com//pull/19532", "diff_url": "/~https://github.com//pull/19532.diff", "patch_url": "/~https://github.com//pull/19532.patch", "merged_at": "2022-12-16T19:14:30Z" }, "body": "We only support String and byte[] and throw otherwise, align the types with it.", "reactions": { "url": "https://api.github.com/repos//issues/19532/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19532/timeline", "performed_via_github_app": null, "state_reason": null }, { "url": "https://api.github.com/repos//issues/19531", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19531/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19531/comments", "events_url": "https://api.github.com/repos//issues/19531/events", "html_url": "/~https://github.com//issues/19531", "id": 1500693576, "node_id": "I_kwDODTssw85ZcsRI", "number": 19531, "title": "[Question]Is there any other method without writing cookie info to a json file in the global-setup.ts file? Or How can I delete the storageState.json file after all the tests are finished? ", "user": { "login": "YusufOzturk-Development", "id": 43332307, "node_id": "MDQ6VXNlcjQzMzMyMzA3", "avatar_url": "/~https://avatars.githubusercontent.com/u/43332307?v=4", "gravatar_id": "", "url": "https://api.github.com/users/YusufOzturk-Development", "html_url": "/~https://github.com/YusufOzturk-Development", "followers_url": "https://api.github.com/users/YusufOzturk-Development/followers", "following_url": "https://api.github.com/users/YusufOzturk-Development/following{/other_user}", "gists_url": "https://api.github.com/users/YusufOzturk-Development/gists{/gist_id}", "starred_url": "https://api.github.com/users/YusufOzturk-Development/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/YusufOzturk-Development/subscriptions", "organizations_url": "https://api.github.com/users/YusufOzturk-Development/orgs", "repos_url": "https://api.github.com/users/YusufOzturk-Development/repos", "events_url": "https://api.github.com/users/YusufOzturk-Development/events{/privacy}", "received_events_url": "https://api.github.com/users/YusufOzturk-Development/received_events", "type": "User", "site_admin": false }, "labels": [], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 1, "created_at": "2022-12-16T18:41:08Z", "updated_at": "2022-12-17T00:51:55Z", "closed_at": "2022-12-17T00:51:55Z", "author_association": "NONE", "active_lock_reason": null, "body": "I m handling spec files with my **core.ts** file . My spec file is channels.e2e.spec. When these spec file called from npm script, it navigates to my **channels.e2e.ts**\r\n\r\n I am doing the login process in the global-setup.ts file. When the npm script runs, the authentication process is works good in global-setup.ts file. Everything is ok.\r\n\r\nBut problem is when global-setup run, storageState json file inludes my cookie and user info. this could be a security hole for my company. How can I delete the storageState.json file after all the tests are finished? Can you show an example according to my code, or is there any other method without writing cookie info to a json file in the global-setup.ts file?\r\n\r\n\r\n\r\n**my npm script**\r\n\r\n`\"pw:staging\": \"NAME=test@domain.com PASS=test npx playwright test channels.spec.ts\"`\r\n\r\n\r\n**this is my global-setup.ts** \r\n\r\n```\r\nimport LoginPageRepository from \"./playwright/pages/login\"\r\nimport { chromium, FullConfig } from '@playwright/test';\r\n\r\nasync function globalSetup(config: FullConfig) {\r\n const { baseURL, storageState, headless } = config.projects[0].use;\r\n const browser = await chromium.launch({ headless });\r\n const page = await browser.newPage();\r\n await page.goto(`${baseURL!}/login`)\r\n await page.locator(LoginPageRepository.emailTextField).type(process.env.NAME!)\r\n await page.locator(LoginPageRepository.passwordTextField).type(process.env.PASS!)\r\n await page.locator(LoginPageRepository.loginButton).click()\r\n await page.waitForTimeout(10000)\r\n\t\tawait page.context().storageState({ path: storageState as string });\r\n\t\tawait browser.close();\r\n\t\r\n\t}\r\n\r\n\r\nexport default globalSetup;\r\n```\r\n\r\n\r\n**this is my playwright.config.ts**\r\n```\r\nimport { type PlaywrightTestConfig, devices } from \"@playwright/test\";\r\nconst config: PlaywrightTestConfig = {\r\n globalSetup: require.resolve('./global-setup'),\r\n reporter: [ ['html', { outputFolder: 'report' }] ],\r\n use: {\r\n headless: false,\r\n baseURL: 'https://test/beta',\r\n storageState: 'storageState.json',\r\n ignoreHTTPSErrors: true\r\n },\r\n projects: [\r\n {\r\n name: \"chromium\",\r\n use: {\r\n ...devices[\"Desktop Chrome\"],\r\n launchOptions: {\r\n args: [\"--disable-web-security\"],\r\n },\r\n },\r\n }\r\n ],\r\n};\r\nexport default config;\r\n```\r\n\r\n**this is my channels.spec.ts file**;\r\n\r\n```\r\nimport Core from \"../../../../core\";\r\nimport { Identity } from \"./identity.api\";\r\n\r\nCore.create(\"Identity\", Identity);\r\n```\r\n\r\n\r\n**This is my channels.e2e.ts file** ;\r\n\r\n```\r\nimport { expect } from \"@playwright/test\"\r\nimport ChannelsPageRepository from \"../../pages/channels\"\r\nimport { Login } from \"../login/login.e2e\"\r\nimport { faker } from '@faker-js/faker';\r\nexport const Channels = {\r\n States: {\r\n fakeName:{} as string\r\n },\r\n API: {},\r\n UI: {\r\n NavigateChannelsPage: {\r\n id:1,\r\n notes:\"navigates channels page\",\r\n tag:\"\",\r\n run: async ({ page }) => {\r\n await page.locator(ChannelsPageRepository.channelsButton).click()\r\n await expect(page).toHaveURL(/\/channels/); \r\n \r\n }\r\n },\r\n ViewEmailChannels: {\r\n id:2,\r\n notes:\"click view my email channels button and navigate mail channels page\",\r\n tag:\"\",\r\n run: async ({ page }) => {\r\n await Channels.UI.NavigateChannelsPage.run({page})\r\n await page.locator(ChannelsPageRepository.viewMyEmailChannelButton).click()\r\n await expect(page).toHaveURL(/\/a_channels/)\r\n }\r\n },\r\n }\r\n}\r\n```\r\n\r\n**this my core.ts file (I am managing **all spec files** here using Core.create method)**\r\n\r\n```\r\nimport { test } from \"@playwright/test\";\r\n\r\nconst Core = {\r\n create(name: string, config: any) {\r\n return (() => {\r\n if (config.API) {\r\n test.describe(`${name}`, async () => {\r\n config.beforeAll && test.beforeAll(config.beforeAll);\r\n config.afterAll && test.afterAll(config.afterAll);\r\n config.beforeEach && test.beforeEach(config.beforeEach);\r\n config.afterEach && test.afterEach(config.afterEach);\r\n await Promise.all(\r\n Object.keys(config.API).map((t) => {\r\n let testContent = config.API[t];\r\n let desc = `API- ${t} - #${testContent.id}# - ${testContent.notes}`;\r\n let skip = testContent.skip || config.API.skip;\r\n let only = testContent.only;\r\n if (skip) {\r\n test.skip(desc, async () => {\r\n return testContent.run();\r\n });\r\n }\r\n if (only) {\r\n test.only(desc, async () => {\r\n return testContent.run();\r\n });\r\n }\r\n if (!skip && !only) {\r\n test(desc, async () => {\r\n return testContent.run();\r\n });\r\n }\r\n })\r\n );\r\n });\r\n }\r\n if (config.UI) {\r\n test.describe(`${name}`, async () => {\r\n config.beforeAll && test.beforeAll(config.beforeAll);\r\n config.afterAll && test.afterAll(config.afterAll);\r\n config.beforeEach && test.beforeEach(config.beforeEach);\r\n config.afterEach && test.afterEach(config.afterEach);\r\n await Promise.all(\r\n Object.keys(config.UI).map((c) => {\r\n let testContent = config.UI[c];\r\n let desc = `UI- ${c} - #${testContent.id}# - ${testContent.notes}`;\r\n let skip = testContent.skip || config.UI.skip;\r\n let only = testContent.only;\r\n if (skip) {\r\n test.skip(desc, async () => {\r\n return testContent.run();\r\n });\r\n }\r\n if (only) {\r\n test.only(desc, async () => {\r\n return testContent.run();\r\n });\r\n }\r\n if (!skip && !only) {\r\n test(desc, async ({ page }) => {\r\n return testContent.run({ page });\r\n });\r\n }\r\n })\r\n );\r\n });\r\n }\r\n })();\r\n },\r\n};\r\n\r\nexport default Core;\r\n\r\n```\r\n\r\n", "reactions": { "url": "https://api.github.com/repos//issues/19531/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19531/timeline", "performed_via_github_app": null, "state_reason": "completed" }, { "url": "https://api.github.com/repos//issues/19528", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19528/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19528/comments", "events_url": "https://api.github.com/repos//issues/19528/events", "html_url": "/~https://github.com//pull/19528", "id": 1500662818, "node_id": "PR_kwDODTssw85FqjUH", "number": 19528, "title": "cherry-pick(#19527): docs: route.fetch.postData in java", "user": { "login": "yury-s", "id": 9798949, "node_id": "MDQ6VXNlcjk3OTg5NDk=", "avatar_url": "/~https://avatars.githubusercontent.com/u/9798949?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yury-s", "html_url": "/~https://github.com/yury-s", "followers_url": "https://api.github.com/users/yury-s/followers", "following_url": "https://api.github.com/users/yury-s/following{/other_user}", "gists_url": "https://api.github.com/users/yury-s/gists{/gist_id}", "starred_url": "https://api.github.com/users/yury-s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yury-s/subscriptions", "organizations_url": "https://api.github.com/users/yury-s/orgs", "repos_url": "https://api.github.com/users/yury-s/repos", "events_url": "https://api.github.com/users/yury-s/events{/privacy}", "received_events_url": "https://api.github.com/users/yury-s/received_events", "type": "User", "site_admin": false }, "labels": [], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 0, "created_at": "2022-12-16T18:15:37Z", "updated_at": "2022-12-16T18:16:41Z", "closed_at": "2022-12-16T18:16:40Z", "author_association": "MEMBER", "active_lock_reason": null, "draft": false, "pull_request": { "url": "https://api.github.com/repos/microsoft/playwright/pulls/19528", "html_url": "/~https://github.com//pull/19528", "diff_url": "/~https://github.com//pull/19528.diff", "patch_url": "/~https://github.com//pull/19528.patch", "merged_at": "2022-12-16T18:16:40Z" }, "body": null, "reactions": { "url": "https://api.github.com/repos//issues/19528/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19528/timeline", "performed_via_github_app": null, "state_reason": null }, { "url": "https://api.github.com/repos//issues/19527", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19527/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19527/comments", "events_url": "https://api.github.com/repos//issues/19527/events", "html_url": "/~https://github.com//pull/19527", "id": 1500654810, "node_id": "PR_kwDODTssw85Fqhku", "number": 19527, "title": "docs: route.fetch.postData in java", "user": { "login": "yury-s", "id": 9798949, "node_id": "MDQ6VXNlcjk3OTg5NDk=", "avatar_url": "/~https://avatars.githubusercontent.com/u/9798949?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yury-s", "html_url": "/~https://github.com/yury-s", "followers_url": "https://api.github.com/users/yury-s/followers", "following_url": "https://api.github.com/users/yury-s/following{/other_user}", "gists_url": "https://api.github.com/users/yury-s/gists{/gist_id}", "starred_url": "https://api.github.com/users/yury-s/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yury-s/subscriptions", "organizations_url": "https://api.github.com/users/yury-s/orgs", "repos_url": "https://api.github.com/users/yury-s/repos", "events_url": "https://api.github.com/users/yury-s/events{/privacy}", "received_events_url": "https://api.github.com/users/yury-s/received_events", "type": "User", "site_admin": false }, "labels": [], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 0, "created_at": "2022-12-16T18:09:26Z", "updated_at": "2022-12-16T18:14:04Z", "closed_at": "2022-12-16T18:14:03Z", "author_association": "MEMBER", "active_lock_reason": null, "draft": false, "pull_request": { "url": "https://api.github.com/repos/microsoft/playwright/pulls/19527", "html_url": "/~https://github.com//pull/19527", "diff_url": "/~https://github.com//pull/19527.diff", "patch_url": "/~https://github.com//pull/19527.patch", "merged_at": "2022-12-16T18:14:02Z" }, "body": null, "reactions": { "url": "https://api.github.com/repos//issues/19527/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19527/timeline", "performed_via_github_app": null, "state_reason": null }, { "url": "https://api.github.com/repos//issues/19521", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19521/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19521/comments", "events_url": "https://api.github.com/repos//issues/19521/events", "html_url": "/~https://github.com//pull/19521", "id": 1500560712, "node_id": "PR_kwDODTssw85FqNSd", "number": 19521, "title": "chery-pick(#19509): docs: fix locator all since version", "user": { "login": "playwrightmachine", "id": 89237858, "node_id": "MDQ6VXNlcjg5MjM3ODU4", "avatar_url": "/~https://avatars.githubusercontent.com/u/89237858?v=4", "gravatar_id": "", "url": "https://api.github.com/users/playwrightmachine", "html_url": "/~https://github.com/playwrightmachine", "followers_url": "https://api.github.com/users/playwrightmachine/followers", "following_url": "https://api.github.com/users/playwrightmachine/following{/other_user}", "gists_url": "https://api.github.com/users/playwrightmachine/gists{/gist_id}", "starred_url": "https://api.github.com/users/playwrightmachine/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/playwrightmachine/subscriptions", "organizations_url": "https://api.github.com/users/playwrightmachine/orgs", "repos_url": "https://api.github.com/users/playwrightmachine/repos", "events_url": "https://api.github.com/users/playwrightmachine/events{/privacy}", "received_events_url": "https://api.github.com/users/playwrightmachine/received_events", "type": "User", "site_admin": false }, "labels": [ { "id": 2992174511, "node_id": "MDU6TGFiZWwyOTkyMTc0NTEx", "url": "https://api.github.com/repos/microsoft/playwright/labels/CQ1", "name": "CQ1", "color": "BA2AAF", "default": false, "description": "" } ], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 0, "created_at": "2022-12-16T17:03:38Z", "updated_at": "2022-12-16T17:19:52Z", "closed_at": "2022-12-16T17:19:51Z", "author_association": "COLLABORATOR", "active_lock_reason": null, "draft": false, "pull_request": { "url": "https://api.github.com/repos/microsoft/playwright/pulls/19521", "html_url": "/~https://github.com//pull/19521", "diff_url": "/~https://github.com//pull/19521.diff", "patch_url": "/~https://github.com//pull/19521.patch", "merged_at": "2022-12-16T17:19:51Z" }, "body": "This PR cherry-picks the following commits:\n\n- 1e31afd", "reactions": { "url": "https://api.github.com/repos//issues/19521/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }, "timeline_url": "https://api.github.com/repos//issues/19521/timeline", "performed_via_github_app": null, "state_reason": null }, { "url": "https://api.github.com/repos//issues/19519", "repository_url": "https://api.github.com/repos/microsoft/playwright", "labels_url": "https://api.github.com/repos//issues/19519/labels{/name}", "comments_url": "https://api.github.com/repos//issues/19519/comments", "events_url": "https://api.github.com/repos//issues/19519/events", "html_url": "/~https://github.com//issues/19519", "id": 1500455014, "node_id": "I_kwDODTssw85ZbyBm", "number": 19519, "title": "[Question] is workerIndex consistent during tests?", "user": { "login": "vovsemenv", "id": 20096510, "node_id": "MDQ6VXNlcjIwMDk2NTEw", "avatar_url": "/~https://avatars.githubusercontent.com/u/20096510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vovsemenv", "html_url": "/~https://github.com/vovsemenv", "followers_url": "https://api.github.com/users/vovsemenv/followers", "following_url": "https://api.github.com/users/vovsemenv/following{/other_user}", "gists_url": "https://api.github.com/users/vovsemenv/gists{/gist_id}", "starred_url": "https://api.github.com/users/vovsemenv/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vovsemenv/subscriptions", "organizations_url": "https://api.github.com/users/vovsemenv/orgs", "repos_url": "https://api.github.com/users/vovsemenv/repos", "events_url": "https://api.github.com/users/vovsemenv/events{/privacy}", "received_events_url": "https://api.github.com/users/vovsemenv/received_events", "type": "User", "site_admin": false }, "labels": [], "state": "closed", "locked": false, "assignee": null, "assignees": [], "milestone": null, "comments": 1, "created_at": "2022-12-16T15:43:28Z", "updated_at": "2022-12-17T19:05:09Z", "closed_at": "2022-12-17T19:05:09Z", "author_association": "NONE", "active_lock_reason": null, "body": "Hello, at allure-report we have timeline view with all the used threads and timings. and this timeline uses workerIndex to determine which thread was used.\r\n\r\n |
Hey Team,
I think the Locator feature is really great, but what I think it lacks is some kind of enumeration. There are evaluations and stuff like getting text from all elements, but that's only a limited use case. While it is possible for us to enumerate by ourselves, I think we could benefit much more from a built in enumerator instead of opting for a for loop. This would allow plugging into more useful features of supported languages for working with collections much easier.
It would then be possible to enumerate in:
The text was updated successfully, but these errors were encountered: