Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Differences:
- Upstream's docs site pages that have no counterpart in the port: the page objects page (`docs/page-objects.mdx`, moved to `/page-object-model` in `d30114a`), `e2e feedback` and the `docs/reference/cli.mdx` text about its opt-out variables (`4c1e2e8`), and `examples/` with its registry (`b3ae3a4`, `38b802d`, `a29edcb`, `b54646f`). The migration guides (`docs/migrate/*.mdx`, `8537abc`) are ported: see [Migration guides](#migration-guides). The docs site has .NET-only guides for upstream's five example apps of `caf51eb` (tester-army/e2e#1497: i18n, file upload, location, biometrics, deep links), under [Examples](docs-site/src/content/docs/examples/index.mdx). They are not ports: that commit only adds registry entries that link to separate repositories, so there was no guide text. Each page writes C# tests for the upstream app. The self-healing deep dive (`6fa99ea`) is ported as the [Self-healing tests](README.md#self-healing-tests) section of the guide, since the port has no docs pages for the cache, the trace page, or executors to link to. Known gap: only `e2e explore` prints a run summary, since it is the one command that feeds a run to `ListReporter` (see [List reporter](#list-reporter)): the `Cache 4 replayed · 1 handed off · 1 missed` row is `Format.CacheText` over `Format.StepsCacheTally` (`E2E.Cli`, upstream's `cacheText` and `stepsCacheTally` of `report/format.ts`), which an exploration, with its cache off, never fills, and a test run does not print ([#799](https://github.com/hardkoded/e2e-dotnet/issues/799))
- Parallel workers and serial suites
- `test.fail` and the `fail` test option (tester-army/e2e#1539, `732ea8a`): a test expected to fail, whose product failure passes and whose pass fails with `UNEXPECTED_PASS`. It lives in upstream's test registry, scheduler, retry, and reporters (`settleExpectedFailure` runs on a finished attempt), and the port has none of them. NUnit and xUnit v3 own the verdict and the retries, and neither has an expected-failure outcome, so a port would need a new public API of its own
- Playwright's page tests in the testbed suite (tester-army/e2e#1505, `bdf769b`) are ported in slices (hardkoded/e2e-dotnet#1060), as the `playwright` category of `tests/E2E.NUnit.Tests`, against the playground's `/content` route and Playwright's test assets (Apache-2.0, `Testbed/playwright/`, with Playwright's `LICENSE` and `NOTICE`). A test upstream marks `{ fail: 'reason' }` keeps its assertions inside the test-only `Helpers.ExpectedToFailAsync`, which passes while the body fails and fails once it passes. Ported so far: `check`, `wait-for-url`, `locator-list`, and `selectors-text` (one test is such a known difference, hardkoded/e2e-dotnet#1062).
- Playwright's page tests in the testbed suite (tester-army/e2e#1505, `bdf769b`) are ported in slices (hardkoded/e2e-dotnet#1060), as the `playwright` category of `tests/E2E.NUnit.Tests`, against the playground's `/content` route and Playwright's test assets (Apache-2.0, `Testbed/playwright/`, with Playwright's `LICENSE` and `NOTICE`). A test upstream marks `{ fail: 'reason' }` keeps its assertions inside the test-only `Helpers.ExpectedToFailAsync`, which passes while the body fails and fails once it passes. Ported so far: `check`, `wait-for-url`, `locator-list`, and `selectors-text`.
- Serial groups (upstream tester-army/e2e#1056, #1470): serial runs, group retries, and skipping the rest of a group after a failure belong to the test runner, which is NUnit or xUnit here, so the port keeps no serial groups. The schema has `serialAttempt.cutRetry` and the serial verdict is read from it, but nothing in the port writes a serial attempt: see [Report document](#report-document)
- The out-of-process engine protocol (upstream tester-army/e2e#1232, [#873](https://github.com/hardkoded/e2e-dotnet/issues/873)): the port has no runner and no worker pool, so there is no engine process to talk to. An engine is written in .NET against `IEngine`
- Diff-only observations for a custom executor's own model turns. The built-in agent has them (#1022): `#id` lines on the opening screen and on `observe`, and a diff after each action (see [MCP server](#mcp-server) for the presenter). `ExecutorObservation.Text`, which an executor reads from `Observe`, keeps the full `[ref=…]` snapshot, cut at the observation byte budget (see [Agents](#agents)), and a node is addressed by its ref there (`new ExecutorTarget("e12")`), so a custom executor has no presenter of its own. Upstream gives every executor the `#id` view.
Expand Down
40 changes: 18 additions & 22 deletions tests/E2E.NUnit.Tests/SelectorsText/SelectorsTextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,28 @@ await Browser.GotoAsync(Content("""
Assert.That(await Screen.GetByText("hello world").GetAttributeAsync("id"), Is.EqualTo("me"));
}

// Known difference, hardkoded/e2e-dotnet#1062: the first getByText('hello') match has no `id`.
[Test]
public async Task HasText_and_internal_text_should_match_full_node_text_in_strict_mode()
{
await ExpectedToFailAsync("Expected span1", async () =>
{
await Browser.GotoAsync(Content("""
<div id=div1>hello<span>world</span></div>
<div id=div2>hello</div>
"""));
await Expect.That(Screen.GetByText("helloworld")).ToHaveAttributeAsync("id", "div1");
await Expect.That(Screen.GetByText("hello")).ToHaveAttributeAsync("id", "div2");
await Expect.That(Browser.Locator("div").Filter(hasText: HelloWorld())).ToHaveAttributeAsync("id", "div1");
await Expect.That(Browser.Locator("div").Filter(hasText: Hello())).ToHaveAttributeAsync("id", "div2");
await Browser.GotoAsync(Content("""
<div id=div1>hello<span>world</span></div>
<div id=div2>hello</div>
"""));
await Expect.That(Screen.GetByText("helloworld")).ToHaveAttributeAsync("id", "div1");
await Expect.That(Screen.GetByText("hello")).ToHaveAttributeAsync("id", "div2");
await Expect.That(Browser.Locator("div").Filter(hasText: HelloWorld())).ToHaveAttributeAsync("id", "div1");
await Expect.That(Browser.Locator("div").Filter(hasText: Hello())).ToHaveAttributeAsync("id", "div2");

await Browser.GotoAsync(Content("""
<div id=div1><span id=span1>hello</span>world</div>
<div id=div2><span id=span2>hello</span></div>
"""));
await Expect.That(Screen.GetByText("helloworld")).ToHaveAttributeAsync("id", "div1");
Equal("span1", await Screen.GetByText("hello").Nth(0).GetAttributeAsync("id"));
Equal("span2", await Screen.GetByText("hello").Nth(1).GetAttributeAsync("id"));
await Expect.That(Screen.GetByText("hello")).ToHaveCountAsync(2);
await Expect.That(Browser.Locator("div").Filter(hasText: HelloWorld())).ToHaveAttributeAsync("id", "div1");
await Expect.That(Browser.Locator("div").Filter(hasText: Hello())).ToHaveAttributeAsync("id", "div2");
});
await Browser.GotoAsync(Content("""
<div id=div1><span id=span1>hello</span>world</div>
<div id=div2><span id=span2>hello</span></div>
"""));
await Expect.That(Screen.GetByText("helloworld")).ToHaveAttributeAsync("id", "div1");
Assert.That(await Screen.GetByText("hello").Nth(0).GetAttributeAsync("id"), Is.EqualTo("span1"));
Assert.That(await Screen.GetByText("hello").Nth(1).GetAttributeAsync("id"), Is.EqualTo("span2"));
await Expect.That(Screen.GetByText("hello")).ToHaveCountAsync(2);
await Expect.That(Browser.Locator("div").Filter(hasText: HelloWorld())).ToHaveAttributeAsync("id", "div1");
await Expect.That(Browser.Locator("div").Filter(hasText: Hello())).ToHaveAttributeAsync("id", "div2");
}

[GeneratedRegex(@"^helloworld$")]
Expand Down
Loading