@hotwired/turbo 7.1.0-rc.3 → 7.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/turbo.es2017-esm.js +1027 -613
  2. package/dist/turbo.es2017-umd.js +1032 -614
  3. package/dist/types/core/bardo.d.ts +7 -2
  4. package/dist/types/core/cache.d.ts +10 -0
  5. package/dist/types/core/drive/error_renderer.d.ts +2 -1
  6. package/dist/types/core/drive/form_submission.d.ts +13 -4
  7. package/dist/types/core/drive/head_snapshot.d.ts +3 -3
  8. package/dist/types/core/drive/history.d.ts +1 -1
  9. package/dist/types/core/drive/navigator.d.ts +4 -3
  10. package/dist/types/core/drive/page_renderer.d.ts +8 -5
  11. package/dist/types/core/drive/page_view.d.ts +8 -5
  12. package/dist/types/core/drive/preloader.d.ts +14 -0
  13. package/dist/types/core/drive/progress_bar.d.ts +1 -0
  14. package/dist/types/core/drive/visit.d.ts +15 -4
  15. package/dist/types/core/frames/frame_controller.d.ts +43 -23
  16. package/dist/types/core/frames/frame_redirector.d.ts +12 -10
  17. package/dist/types/core/frames/frame_renderer.d.ts +8 -1
  18. package/dist/types/core/frames/frame_view.d.ts +2 -1
  19. package/dist/types/core/index.d.ts +14 -4
  20. package/dist/types/core/native/adapter.d.ts +3 -2
  21. package/dist/types/core/native/browser_adapter.d.ts +18 -9
  22. package/dist/types/core/renderer.d.ts +11 -5
  23. package/dist/types/core/session.d.ts +78 -19
  24. package/dist/types/core/snapshot.d.ts +2 -1
  25. package/dist/types/core/streams/stream_message.d.ts +2 -6
  26. package/dist/types/core/types.d.ts +4 -0
  27. package/dist/types/core/view.d.ts +13 -7
  28. package/dist/types/elements/frame_element.d.ts +10 -6
  29. package/dist/types/elements/stream_element.d.ts +3 -0
  30. package/dist/types/elements/stream_source_element.d.ts +7 -0
  31. package/dist/types/http/fetch_request.d.ts +9 -0
  32. package/dist/types/observers/cache_observer.d.ts +1 -1
  33. package/dist/types/observers/form_link_click_observer.d.ts +14 -0
  34. package/dist/types/observers/form_submit_observer.d.ts +2 -1
  35. package/dist/types/observers/link_click_observer.d.ts +5 -4
  36. package/dist/types/polyfills/submit-event.d.ts +1 -7
  37. package/dist/types/tests/functional/async_script_tests.d.ts +1 -6
  38. package/dist/types/tests/functional/autofocus_tests.d.ts +1 -9
  39. package/dist/types/tests/functional/cache_observer_tests.d.ts +1 -5
  40. package/dist/types/tests/functional/drive_disabled_tests.d.ts +1 -9
  41. package/dist/types/tests/functional/drive_tests.d.ts +1 -8
  42. package/dist/types/tests/functional/form_mode_tests.d.ts +1 -0
  43. package/dist/types/tests/functional/form_submission_tests.d.ts +1 -84
  44. package/dist/types/tests/functional/frame_navigation_tests.d.ts +1 -7
  45. package/dist/types/tests/functional/frame_tests.d.ts +1 -51
  46. package/dist/types/tests/functional/import_tests.d.ts +1 -4
  47. package/dist/types/tests/functional/loading_tests.d.ts +1 -13
  48. package/dist/types/tests/functional/navigation_tests.d.ts +1 -37
  49. package/dist/types/tests/functional/pausable_rendering_tests.d.ts +1 -6
  50. package/dist/types/tests/functional/pausable_requests_tests.d.ts +1 -6
  51. package/dist/types/tests/functional/preloader_tests.d.ts +1 -0
  52. package/dist/types/tests/functional/rendering_tests.d.ts +1 -35
  53. package/dist/types/tests/functional/scroll_restoration_tests.d.ts +1 -6
  54. package/dist/types/tests/functional/stream_tests.d.ts +1 -6
  55. package/dist/types/tests/functional/visit_tests.d.ts +1 -14
  56. package/dist/types/tests/helpers/page.d.ts +44 -0
  57. package/dist/types/tests/unit/deprecated_adapter_support_test.d.ts +10 -10
  58. package/dist/types/util.d.ts +12 -3
  59. package/package.json +22 -8
  60. package/CHANGELOG.md +0 -3
  61. package/dist/types/core/frames/form_interceptor.d.ts +0 -12
  62. package/dist/types/core/frames/link_interceptor.d.ts +0 -16
  63. package/dist/types/tests/functional/index.d.ts +0 -17
  64. package/dist/types/tests/helpers/functional_test_case.d.ts +0 -44
  65. package/dist/types/tests/helpers/remote_channel.d.ts +0 -10
  66. package/dist/types/tests/helpers/turbo_drive_test_case.d.ts +0 -21
@@ -1,37 +1 @@
1
- import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
2
- export declare class NavigationTests extends TurboDriveTestCase {
3
- setup(): Promise<void>;
4
- "test navigating renders a progress bar"(): Promise<void>;
5
- "test navigating does not render a progress bar before expiring the delay"(): Promise<void>;
6
- "test after loading the page"(): Promise<void>;
7
- "test following a same-origin unannotated link"(): Promise<void>;
8
- "test following a same-origin unannotated custom element link"(): Promise<void>;
9
- "test following a same-origin unannotated form[method=GET]"(): Promise<void>;
10
- "test following a same-origin data-turbo-action=replace link"(): Promise<void>;
11
- "test following a same-origin GET form[data-turbo-action=replace]"(): Promise<void>;
12
- "test following a same-origin GET form button[data-turbo-action=replace]"(): Promise<void>;
13
- "test following a same-origin POST form[data-turbo-action=replace]"(): Promise<void>;
14
- "test following a same-origin POST form button[data-turbo-action=replace]"(): Promise<void>;
15
- "test following a same-origin data-turbo=false link"(): Promise<void>;
16
- "test following a same-origin unannotated link inside a data-turbo=false container"(): Promise<void>;
17
- "test following a same-origin data-turbo=true link inside a data-turbo=false container"(): Promise<void>;
18
- "test following a same-origin anchored link"(): Promise<void>;
19
- "test following a same-origin link to a named anchor"(): Promise<void>;
20
- "test following a cross-origin unannotated link"(): Promise<void>;
21
- "test following a same-origin [target] link"(): Promise<void>;
22
- "test following a same-origin [download] link"(): Promise<void>;
23
- "test following a same-origin link inside an SVG element"(): Promise<void>;
24
- "test following a cross-origin link inside an SVG element"(): Promise<void>;
25
- "test clicking the back button"(): Promise<void>;
26
- "test clicking the forward button"(): Promise<void>;
27
- "test link targeting a disabled turbo-frame navigates the page"(): Promise<void>;
28
- "test skip link with hash-only path scrolls to the anchor without a visit"(): Promise<void>;
29
- "test skip link with hash-only path moves focus and changes tab order"(): Promise<void>;
30
- "test same-page anchored replace link assumes the intention was a refresh"(): Promise<void>;
31
- "test navigating back to anchored URL"(): Promise<void>;
32
- "test following a redirection"(): Promise<void>;
33
- "test clicking the back button after redirection"(): Promise<void>;
34
- "test same-page anchor visits do not trigger visit events"(): Promise<void>;
35
- "test correct referrer header"(): Promise<void>;
36
- "test double-clicking on a link"(): Promise<void>;
37
- }
1
+ export {};
@@ -1,6 +1 @@
1
- import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
2
- export declare class PausableRenderingTests extends TurboDriveTestCase {
3
- setup(): Promise<void>;
4
- "test pauses and resumes rendering"(): Promise<void>;
5
- "test aborts rendering"(): Promise<void>;
6
- }
1
+ export {};
@@ -1,6 +1 @@
1
- import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
2
- export declare class PausableRequestsTests extends TurboDriveTestCase {
3
- setup(): Promise<void>;
4
- "test pauses and resumes request"(): Promise<void>;
5
- "test aborts request"(): Promise<void>;
6
- }
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,41 +1,7 @@
1
- import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
2
- import { Element } from "@theintern/leadfoot";
3
- export declare class RenderingTests extends TurboDriveTestCase {
4
- setup(): Promise<void>;
5
- "test triggers before-render and render events"(): Promise<void>;
6
- "test triggers before-render and render events for error pages"(): Promise<void>;
7
- "test reloads when tracked elements change"(): Promise<void>;
8
- "test wont reload when tracked elements has a nonce"(): Promise<void>;
9
- "test reloads when turbo-visit-control setting is reload"(): Promise<void>;
10
- "test accumulates asset elements in head"(): Promise<void>;
11
- "test replaces provisional elements in head"(): Promise<void>;
12
- "test evaluates head stylesheet elements"(): Promise<void>;
13
- "test does not evaluate head stylesheet elements inside noscript elements"(): Promise<void>;
14
- "skip evaluates head script elements once"(): Promise<void>;
15
- "test evaluates body script elements on each render"(): Promise<void>;
16
- "test does not evaluate data-turbo-eval=false scripts"(): Promise<void>;
17
- "test preserves permanent elements"(): Promise<void>;
18
- "test preserves permanent elements within turbo-frames"(): Promise<void>;
19
- "test preserves permanent elements within turbo-frames rendered without layouts"(): Promise<void>;
20
- "test preserves permanent element video playback"(): Promise<void>;
21
- "test before-cache event"(): Promise<void>;
22
- "test mutation record as before-cache notification"(): Promise<void>;
23
- "test error pages"(): Promise<void>;
24
- get assetElements(): Promise<Element[]>;
25
- get provisionalElements(): Promise<Element[]>;
26
- get headElements(): Promise<Element[]>;
27
- get permanentElement(): Promise<Element>;
28
- get headScriptEvaluationCount(): Promise<number | undefined>;
29
- get bodyScriptEvaluationCount(): Promise<number | undefined>;
30
- get isStylesheetEvaluated(): Promise<boolean>;
31
- get isNoscriptStylesheetEvaluated(): Promise<boolean>;
32
- modifyBodyBeforeCaching(): Promise<any>;
33
- beforeCache(callback: (body: HTMLElement) => void): Promise<any>;
34
- modifyBodyAfterRemoval(): Promise<any>;
35
- }
36
1
  declare global {
37
2
  interface Window {
38
3
  headScriptEvaluationCount?: number;
39
4
  bodyScriptEvaluationCount?: number;
40
5
  }
41
6
  }
7
+ export {};
@@ -1,6 +1 @@
1
- import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
2
- export declare class ScrollRestorationTests extends TurboDriveTestCase {
3
- "test landing on an anchor"(): Promise<void>;
4
- "test reloading after scrolling"(): Promise<void>;
5
- "test returning from history"(): Promise<void>;
6
- }
1
+ export {};
@@ -1,6 +1 @@
1
- import { FunctionalTestCase } from "../helpers/functional_test_case";
2
- export declare class StreamTests extends FunctionalTestCase {
3
- setup(): Promise<void>;
4
- "test receiving a stream message"(): Promise<void>;
5
- "test receiving a stream message with css selector target"(): Promise<void>;
6
- }
1
+ export {};
@@ -1,14 +1 @@
1
- import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
2
- export declare class VisitTests extends TurboDriveTestCase {
3
- setup(): Promise<void>;
4
- "test programmatically visiting a same-origin location"(): Promise<void>;
5
- "skip programmatically visiting a cross-origin location falls back to window.location"(): Promise<void>;
6
- "test visiting a location served with a non-HTML content type"(): Promise<void>;
7
- "test canceling a before-visit event prevents navigation"(): Promise<void>;
8
- "test navigation by history is not cancelable"(): Promise<void>;
9
- "test turbo:before-fetch-request event.detail"(): Promise<void>;
10
- "test turbo:before-fetch-response open new site"(): Promise<void>;
11
- "test cache does not override response after redirect"(): Promise<void>;
12
- visitLocation(location: string): Promise<void>;
13
- cancelNextVisit(): Promise<void>;
14
- }
1
+ export {};
@@ -0,0 +1,44 @@
1
+ import { JSHandle, Locator, Page } from "@playwright/test";
2
+ declare type EventLog = [string, any, string | null];
3
+ declare type MutationLog = [string, string | null, string | null];
4
+ export declare function attributeForSelector(page: Page, selector: string, attributeName: string): Promise<string | null>;
5
+ export declare function clickWithoutScrolling(page: Page, selector: string, options?: {}): Promise<false | void>;
6
+ export declare function clearLocalStorage(page: Page): Promise<void>;
7
+ export declare function disposeAll(...handles: JSHandle[]): Promise<void[]>;
8
+ export declare function getFromLocalStorage(page: Page, key: string): Promise<string | null>;
9
+ export declare function getSearchParam(url: string, key: string): string | null;
10
+ export declare function hash(url: string): string;
11
+ export declare function hasSelector(page: Page, selector: string): Promise<boolean>;
12
+ export declare function innerHTMLForSelector(page: Page, selector: string): Promise<string>;
13
+ export declare function isScrolledToSelector(page: Page, selector: string): Promise<boolean>;
14
+ export declare function nextBeat(): Promise<void>;
15
+ export declare function nextBody(_page: Page, timeout?: number): Promise<void>;
16
+ export declare function nextEventNamed(page: Page, eventName: string): Promise<any>;
17
+ export declare function nextEventOnTarget(page: Page, elementId: string, eventName: string): Promise<any>;
18
+ export declare function nextAttributeMutationNamed(page: Page, elementId: string, attributeName: string): Promise<string | null>;
19
+ export declare function noNextEventNamed(page: Page, eventName: string): Promise<boolean>;
20
+ export declare function noNextEventOnTarget(page: Page, elementId: string, eventName: string): Promise<boolean>;
21
+ export declare function outerHTMLForSelector(page: Page, selector: string): Promise<string>;
22
+ export declare function pathname(url: string): string;
23
+ export declare function propertyForSelector(page: Page, selector: string, propertyName: string): Promise<any>;
24
+ export declare function readEventLogs(page: Page, length?: number): Promise<EventLog[]>;
25
+ export declare function readMutationLogs(page: Page, length?: number): Promise<MutationLog[]>;
26
+ export declare function search(url: string): string;
27
+ export declare function searchParams(url: string): URLSearchParams;
28
+ export declare function selectorHasFocus(page: Page, selector: string): Promise<boolean>;
29
+ export declare function setLocalStorageFromEvent(page: Page, eventName: string, storageKey: string, storageValue: string): Promise<void>;
30
+ export declare function scrollPosition(page: Page): Promise<{
31
+ x: number;
32
+ y: number;
33
+ }>;
34
+ export declare function isScrolledToTop(page: Page): Promise<boolean>;
35
+ export declare function scrollToSelector(page: Page, selector: string): Promise<void>;
36
+ export declare function sleep(timeout?: number): Promise<void>;
37
+ export declare function strictElementEquals(left: Locator, right: Locator): Promise<boolean>;
38
+ export declare function textContent(page: Page, html: string): Promise<string | null>;
39
+ export declare function visitAction(page: Page): Promise<string>;
40
+ export declare function waitForPathname(page: Page, pathname: string): Promise<void>;
41
+ export declare function waitUntilSelector(page: Page, selector: string, state?: "visible" | "attached"): Promise<import("playwright-core").ElementHandle<HTMLElement | SVGElement>>;
42
+ export declare function waitUntilNoSelector(page: Page, selector: string, state?: "hidden" | "detached"): Promise<import("playwright-core").ElementHandle<HTMLElement | SVGElement> | null>;
43
+ export declare function willChangeBody(page: Page, callback: () => Promise<void>): Promise<boolean>;
44
+ export {};
@@ -9,16 +9,16 @@ export declare class DeprecatedAdapterSupportTest extends DOMTestCase implements
9
9
  teardown(): Promise<void>;
10
10
  "test visit proposal location includes deprecated absoluteURL property"(): Promise<void>;
11
11
  "test visit start location includes deprecated absoluteURL property"(): Promise<void>;
12
- visitProposedToLocation(location: URL, options?: Partial<VisitOptions>): void;
12
+ visitProposedToLocation(location: URL, _options?: Partial<VisitOptions>): Promise<void>;
13
13
  visitStarted(visit: Visit): void;
14
- visitCompleted(visit: Visit): void;
15
- visitFailed(visit: Visit): void;
16
- visitRequestStarted(visit: Visit): void;
17
- visitRequestCompleted(visit: Visit): void;
18
- visitRequestFailedWithStatusCode(visit: Visit, statusCode: number): void;
19
- visitRequestFinished(visit: Visit): void;
20
- visitRendered(visit: Visit): void;
21
- formSubmissionStarted(formSubmission: FormSubmission): void;
22
- formSubmissionFinished(formSubmission: FormSubmission): void;
14
+ visitCompleted(_visit: Visit): void;
15
+ visitFailed(_visit: Visit): void;
16
+ visitRequestStarted(_visit: Visit): void;
17
+ visitRequestCompleted(_visit: Visit): void;
18
+ visitRequestFailedWithStatusCode(_visit: Visit, _statusCode: number): void;
19
+ visitRequestFinished(_visit: Visit): void;
20
+ visitRendered(_visit: Visit): void;
21
+ formSubmissionStarted(_formSubmission: FormSubmission): void;
22
+ formSubmissionFinished(_formSubmission: FormSubmission): void;
23
23
  pageInvalidated(): void;
24
24
  }
@@ -1,9 +1,12 @@
1
- export declare type DispatchOptions = {
1
+ import { Action } from "./core/types";
2
+ export declare type DispatchOptions<T extends CustomEvent> = {
2
3
  target: EventTarget;
3
4
  cancelable: boolean;
4
- detail: any;
5
+ detail: T["detail"];
5
6
  };
6
- export declare function dispatch(eventName: string, { target, cancelable, detail }?: Partial<DispatchOptions>): CustomEvent<any>;
7
+ export declare function activateScriptElement(element: HTMLScriptElement): HTMLScriptElement;
8
+ export declare function createDocumentFragment(html: string): DocumentFragment;
9
+ export declare function dispatch<T extends CustomEvent>(eventName: string, { target, cancelable, detail }?: Partial<DispatchOptions<T>>): CustomEvent<T["detail"]>;
7
10
  export declare function nextAnimationFrame(): Promise<void>;
8
11
  export declare function nextEventLoopTick(): Promise<void>;
9
12
  export declare function nextMicrotask(): Promise<void>;
@@ -13,3 +16,9 @@ export declare function uuid(): string;
13
16
  export declare function getAttribute(attributeName: string, ...elements: (Element | undefined)[]): string | null;
14
17
  export declare function markAsBusy(...elements: Element[]): void;
15
18
  export declare function clearBusyState(...elements: Element[]): void;
19
+ export declare function waitForLoad(element: HTMLLinkElement, timeoutInMilliseconds?: number): Promise<void>;
20
+ export declare function getHistoryMethodForAction(action: Action): (data: any, unused: string, url?: string | URL | null | undefined) => void;
21
+ export declare function getVisitAction(...elements: (Element | undefined)[]): Action | null;
22
+ export declare function getMetaElement(name: string): HTMLMetaElement | null;
23
+ export declare function getMetaContent(name: string): string | null;
24
+ export declare function setMetaContent(name: string, content: string): HTMLMetaElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotwired/turbo",
3
- "version": "7.1.0-rc.3",
3
+ "version": "7.2.0-beta.2",
4
4
  "description": "The speed of a single-page web application without having to write any JavaScript",
5
5
  "module": "dist/turbo.es2017-esm.js",
6
6
  "main": "dist/turbo.es2017-umd.js",
@@ -35,15 +35,23 @@
35
35
  "access": "public"
36
36
  },
37
37
  "devDependencies": {
38
- "@rollup/plugin-node-resolve": "9.0.0",
39
- "@rollup/plugin-typescript": "^6.0.0",
38
+ "@playwright/test": "^1.22.2",
39
+ "@rollup/plugin-node-resolve": "13.1.3",
40
+ "@rollup/plugin-typescript": "8.3.1",
40
41
  "@types/multer": "^1.4.5",
42
+ "@typescript-eslint/eslint-plugin": "^5.20.0",
43
+ "@typescript-eslint/parser": "^5.20.0",
44
+ "arg": "^5.0.1",
45
+ "chai": "~4.3.4",
46
+ "eslint": "^8.13.0",
47
+ "eslint-config-prettier": "^8.5.0",
48
+ "eslint-plugin-prettier": "^4.0.0",
41
49
  "intern": "^4.9.0",
42
- "arg": "^4.1.0",
43
50
  "multer": "^1.4.2",
51
+ "prettier": "2.6.2",
44
52
  "rollup": "^2.35.1",
45
53
  "tslib": "^2.0.3",
46
- "typescript": "^4.1.3"
54
+ "typescript": "^4.6.3"
47
55
  },
48
56
  "scripts": {
49
57
  "clean": "rm -fr dist",
@@ -52,9 +60,15 @@
52
60
  "build:win": "tsc --noEmit false --declaration true --emitDeclarationOnly true --outDir dist/types & rollup -c",
53
61
  "watch": "rollup -wc",
54
62
  "start": "node src/tests/runner.js serveOnly",
55
- "test": "NODE_OPTIONS=--inspect node src/tests/runner.js",
56
- "test:win": "SET NODE_OPTIONS=--inspect & node src/tests/runner.js",
63
+ "test": "yarn test:unit && yarn test:browser",
64
+ "test:browser": "playwright test",
65
+ "test:unit": "NODE_OPTIONS=--inspect node src/tests/runner.js",
66
+ "test:unit:win": "SET NODE_OPTIONS=--inspect & node src/tests/runner.js",
57
67
  "prerelease": "yarn build && git --no-pager diff && echo && npm pack --dry-run && echo && read -n 1 -p \"Look OK? Press any key to publish and commit v$npm_package_version\" && echo",
58
- "release": "npm publish && git commit -am \"$npm_package_name v$npm_package_version\" && git push"
68
+ "release": "npm publish && git commit -am \"$npm_package_name v$npm_package_version\" && git push",
69
+ "lint": "eslint . --ext .ts"
70
+ },
71
+ "engines": {
72
+ "node": ">= 14"
59
73
  }
60
74
  }
package/CHANGELOG.md DELETED
@@ -1,3 +0,0 @@
1
- # Changelog
2
-
3
- Please see [our GitHub "Releases" page](https://github.com/hotwired/turbo/releases).
@@ -1,12 +0,0 @@
1
- export interface FormInterceptorDelegate {
2
- shouldInterceptFormSubmission(element: HTMLFormElement, submitter?: HTMLElement): boolean;
3
- formSubmissionIntercepted(element: HTMLFormElement, submitter?: HTMLElement): void;
4
- }
5
- export declare class FormInterceptor {
6
- readonly delegate: FormInterceptorDelegate;
7
- readonly element: Element;
8
- constructor(delegate: FormInterceptorDelegate, element: Element);
9
- start(): void;
10
- stop(): void;
11
- submitBubbled: EventListener;
12
- }
@@ -1,16 +0,0 @@
1
- export interface LinkInterceptorDelegate {
2
- shouldInterceptLinkClick(element: Element, url: string): boolean;
3
- linkClickIntercepted(element: Element, url: string): void;
4
- }
5
- export declare class LinkInterceptor {
6
- readonly delegate: LinkInterceptorDelegate;
7
- readonly element: Element;
8
- private clickEvent?;
9
- constructor(delegate: LinkInterceptorDelegate, element: Element);
10
- start(): void;
11
- stop(): void;
12
- clickBubbled: (event: Event) => void;
13
- linkClicked: EventListener;
14
- willVisit: () => void;
15
- respondsToEventTarget(target: EventTarget | null): boolean | null;
16
- }
@@ -1,17 +0,0 @@
1
- export * from "./async_script_tests";
2
- export * from "./autofocus_tests";
3
- export * from "./cache_observer_tests";
4
- export * from "./drive_disabled_tests";
5
- export * from "./drive_tests";
6
- export * from "./form_submission_tests";
7
- export * from "./frame_tests";
8
- export * from "./import_tests";
9
- export * from "./frame_navigation_tests";
10
- export * from "./loading_tests";
11
- export * from "./navigation_tests";
12
- export * from "./pausable_rendering_tests";
13
- export * from "./pausable_requests_tests";
14
- export * from "./rendering_tests";
15
- export * from "./scroll_restoration_tests";
16
- export * from "./stream_tests";
17
- export * from "./visit_tests";
@@ -1,44 +0,0 @@
1
- import { InternTestCase } from "./intern_test_case";
2
- import { Element } from "@theintern/leadfoot";
3
- export declare class FunctionalTestCase extends InternTestCase {
4
- get remote(): import("intern/lib/executors/Node").Remote;
5
- goToLocation(location: string): Promise<void>;
6
- goBack(): Promise<void>;
7
- goForward(): Promise<void>;
8
- reload(): Promise<void>;
9
- hasSelector(selector: string): Promise<boolean>;
10
- selectorHasFocus(selector: string): Promise<boolean>;
11
- querySelector(selector: string): Promise<Element>;
12
- waitUntilSelector(selector: string): Promise<void>;
13
- waitUntilNoSelector(selector: string): Promise<void>;
14
- querySelectorAll(selector: string): Promise<Element[]>;
15
- clickSelector(selector: string): Promise<void>;
16
- scrollToSelector(selector: string): Promise<void>;
17
- pressTab(): Promise<void>;
18
- outerHTMLForSelector(selector: string): Promise<string>;
19
- innerHTMLForSelector(selector: string): Promise<string>;
20
- attributeForSelector(selector: string, attributeName: string): Promise<string | null>;
21
- propertyForSelector(selector: string, attributeName: string): Promise<any>;
22
- get scrollPosition(): Promise<{
23
- x: number;
24
- y: number;
25
- }>;
26
- isScrolledToTop(): Promise<boolean>;
27
- isScrolledToSelector(selector: string): Promise<boolean>;
28
- get nextBeat(): Promise<void>;
29
- sleep(ms: number): Promise<void>;
30
- evaluate<T>(callback: (...args: any[]) => T, ...args: any[]): Promise<T>;
31
- get head(): Promise<Element>;
32
- get body(): Promise<Element>;
33
- get location(): Promise<string>;
34
- get origin(): Promise<string>;
35
- get pathname(): Promise<string>;
36
- get search(): Promise<string>;
37
- get searchParams(): Promise<URLSearchParams>;
38
- getSearchParam(key: string): Promise<string>;
39
- getAllSearchParams(key: string): Promise<string[]>;
40
- get hash(): Promise<string>;
41
- acceptAlert(): Promise<void>;
42
- dismissAlert(): Promise<void>;
43
- getAlertText(): Promise<string>;
44
- }
@@ -1,10 +0,0 @@
1
- import { Remote } from "intern/lib/executors/Node";
2
- export declare class RemoteChannel<T> {
3
- readonly remote: Remote;
4
- readonly identifier: string;
5
- private index;
6
- constructor(remote: Remote, identifier: string);
7
- read(length?: number): Promise<T[]>;
8
- drain(): Promise<void>;
9
- private get newRecords();
10
- }
@@ -1,21 +0,0 @@
1
- import { FunctionalTestCase } from "./functional_test_case";
2
- import { RemoteChannel } from "./remote_channel";
3
- import { Element } from "@theintern/leadfoot";
4
- declare type EventLog = [string, any, string | null];
5
- declare type MutationLog = [string, string | null, string | null];
6
- export declare class TurboDriveTestCase extends FunctionalTestCase {
7
- eventLogChannel: RemoteChannel<EventLog>;
8
- mutationLogChannel: RemoteChannel<MutationLog>;
9
- lastBody?: Element;
10
- beforeTest(): Promise<void>;
11
- get nextWindowHandle(): Promise<string>;
12
- nextEventNamed(eventName: string): Promise<any>;
13
- noNextEventNamed(eventName: string): Promise<boolean>;
14
- nextEventOnTarget(elementId: string, eventName: string): Promise<any>;
15
- nextAttributeMutationNamed(elementId: string, attributeName: string): Promise<string | null>;
16
- get nextBody(): Promise<Element>;
17
- get changedBody(): Promise<Element | undefined>;
18
- get visitAction(): Promise<string>;
19
- drainEventLog(): Promise<void>;
20
- }
21
- export {};