-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(app): render spec list, command log, iframe #18372
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
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
3cfb0c2
wip
lmiller1990 6c515b8
wip
lmiller1990 e3ef11a
wip
lmiller1990 df79dbe
pre-bundle deps
lmiller1990 240259f
Merge branch 'lmiller1990/fix-app-deps' into lmiller1990/spike-runner-2
lmiller1990 2fe90f6
wip
lmiller1990 2e18a14
wip: spec
lmiller1990 7aa3daa
clear iframe
lmiller1990 5edcbd7
wip: it kind of works
lmiller1990 264f1f9
wip, docs
lmiller1990 cabeaba
wip
lmiller1990 273cd66
update runner API
lmiller1990 3c3c691
wip
lmiller1990 e59feb3
remove comments
lmiller1990 5653188
do not render header
lmiller1990 e5bb592
revert some stuff
lmiller1990 3019505
remove test
lmiller1990 e1b58d3
update tests to work with react 17
lmiller1990 2914120
types
lmiller1990 eecce0b
wip
lmiller1990 f649fe0
revert react deps
lmiller1990 ebd1d21
move code around
lmiller1990 2bbfd29
add back hash change code
lmiller1990 961291e
lint
lmiller1990 f09b7c2
comment
lmiller1990 3441853
update readme
lmiller1990 d54a9ec
resolve conflict
lmiller1990 3676628
remove commet
lmiller1990 c20874a
revert yarn lock
lmiller1990 721538c
remove unused file
lmiller1990 dff4538
Delete HelloWorld1.spec.tsx
JessicaSachs 972014c
Delete HelloWorld2.spec.tsx
JessicaSachs 42fc18f
Merge remote-tracking branch 'origin/unified-desktop-gui' into lmille…
lmiller1990 54b2402
Merge branch 'lmiller1990/spike-runner-3' of https://github.com/cypre…
lmiller1990 bc16f33
merge in unified-desktop-gui
lmiller1990 cb5e4c5
update types
lmiller1990 4197f80
fix ui
lmiller1990 29bc749
fix bugs
lmiller1990 1057e92
fix test
lmiller1990 8579aab
remove dead code
lmiller1990 b07c940
more dead code
lmiller1990 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| describe('App', () => { | ||
| it('resolves the home page', () => { | ||
| cy.visit('http://localhost:5556') | ||
| cy.get('[href="#/runs"]').click() | ||
| cy.get('[href="#/settings"]').click() | ||
| cy.get('[href="/__vite__/runner"]').click() | ||
| cy.get('[href="/__vite__/settings"]').click() | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import type { Store } from './src/store' | ||
|
|
||
| interface ConnectionInfo { | ||
| automationElement: '__cypress-string', | ||
| randomString: string | ||
| } | ||
|
|
||
| export {} | ||
|
|
||
| /** | ||
| * The eventManager and driver are bundled separately | ||
| * by webpack. We cannot import them because of | ||
| * circular dependencies. | ||
| * To work around this, we build the driver, eventManager | ||
| * and some other dependencies using webpack, and consumed the dist'd | ||
| * source code. | ||
| * | ||
| * This is attached to `window` under the `UnifiedRunner` namespace. | ||
| * | ||
| * For now, just declare the types that we need to give us type safety where possible. | ||
| * Eventually, we should decouple the event manager and import it directly. | ||
| */ | ||
| declare global { | ||
| interface Window { | ||
| UnifiedRunner: { | ||
| /** | ||
| * decode config, which we receive as a base64 string | ||
| * This comes from Driver.utils | ||
| */ | ||
| decodeBase64: (base64: string) => Record<string, unknown> | ||
|
|
||
| /** | ||
| * Proxy event to the reporter via `Reporter.defaultEvents.emit` | ||
| */ | ||
| emit (evt: string, ...args: unknown[]): void | ||
|
|
||
| /** | ||
| * This is the eventManager which orchestrates all the communication | ||
| * between the reporter, driver, and server, as well as handle | ||
| * setup, teardown and running of specs. | ||
| * | ||
| * It's only used on the "Runner" part of the unified runner. | ||
| */ | ||
| eventManager: { | ||
| addGlobalListeners: (state: Store, connectionInfo: ConnectionInfo) => void | ||
| setup: (config: Record<string, unknown>) => void | ||
| initialize: ($autIframe: JQuery<HTMLIFrameElement>, config: Record<string, unknown>) => void | ||
| teardown: (state: Store) => Promise<void> | ||
| teardownReporter: () => Promise<void> | ||
| [key: string]: any | ||
| } | ||
|
|
||
| /** | ||
| * To ensure we are only a single copy of React | ||
| * We get a reference to the copy of React (and React DOM) | ||
| * that is used in the Reporter and Driver, which are bundled with | ||
| * webpack. | ||
| * | ||
| * Unfortunately, attempting to have React in a project | ||
| * using Vue causes mad conflicts because React'S JSX type | ||
| * is ambient, so we cannot actually type it. | ||
| */ | ||
| React: any | ||
| ReactDOM: any | ||
|
|
||
| /** | ||
| * Any React components or general code needed from | ||
| * runner-shared, reporter or driver are also bundled with | ||
| * webpack and made available via the window.UnifedRunner namespace. | ||
| * | ||
| * We cannot import the correct types, because this causes the linter and type | ||
| * checker to run on runner-shared and reporter, and it blows up. | ||
| */ | ||
| AutIframe: any | ||
| Reporter: any | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,12 @@ | ||
| <template> | ||
| <router-view v-slot="{ Component }"> | ||
| <keep-alive> | ||
| <component :is="Component" /> | ||
| </keep-alive> | ||
| <!-- | ||
| TODO(lachlan): put this back after doing proper cleanup when unmounting the runner page | ||
| keep-alive works fine for Vue but has some weird effects on the React based Reporter | ||
| For now it's way more simple to just unmount and remount the components when changing page. | ||
| --> | ||
| <!-- <keep-alive> --> | ||
| <component :is="Component" /> | ||
| <!-- </keep-alive> --> | ||
| </router-view> | ||
| </template> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,42 @@ | ||
| <template> | ||
| <div> | ||
| <h2>Specs Page</h2> | ||
| <template v-if="query.data.value?.app"> | ||
| <SpecsList :gql="query.data.value?.app" /> | ||
| </template> | ||
| <p v-else> | ||
| Loading... | ||
| </p> | ||
| </div> | ||
| <h2>Specs Page</h2> | ||
|
|
||
| <SpecsList | ||
| v-if="props.gql" | ||
| :gql="props?.gql" | ||
| /> | ||
|
|
||
| <p v-else> | ||
| Loading... | ||
| </p> | ||
| </template> | ||
|
|
||
| <script lang="ts" setup> | ||
| import { gql } from '@urql/core' | ||
| import { useQuery } from '@urql/vue' | ||
| import { Specs_AppDocument } from '../generated/graphql' | ||
| import { gql } from '@urql/vue' | ||
| import SpecsList from '../specs/SpecsList.vue' | ||
| import { REPORTER_ID, RUNNER_ID } from '../runner/utils' | ||
| import type { Specs_SpecsFragment } from '../generated/graphql' | ||
|
|
||
| gql` | ||
| query Specs_App { | ||
| app { | ||
| ...SpecsList | ||
| } | ||
| } | ||
| ` | ||
|
|
||
| const query = useQuery({ | ||
| query: Specs_AppDocument, | ||
| }) | ||
| fragment Specs_Specs on App { | ||
| ...Specs_SpecsList | ||
| }` | ||
|
|
||
| const props = defineProps<{ | ||
| gql: Specs_SpecsFragment | ||
| }>() | ||
| </script> | ||
|
|
||
| <route> | ||
| { | ||
| name: "Specs Page" | ||
| } | ||
| </route> | ||
|
|
||
| <style> | ||
| iframe { | ||
| border: 5px solid black; | ||
| margin: 10px; | ||
| background: lightgray; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| import { createWebHashHistory, createRouter as _createRouter } from 'vue-router' | ||
| import { createRouter as _createRouter, createWebHistory } from 'vue-router' | ||
| import generatedRoutes from 'virtual:generated-pages' | ||
| import { setupLayouts } from 'virtual:generated-layouts' | ||
|
|
||
| export const createRouter = () => { | ||
| const routes = setupLayouts(generatedRoutes) | ||
|
|
||
| return _createRouter({ | ||
| history: createWebHashHistory(), | ||
| history: createWebHistory('/__vite__/'), | ||
| routes, | ||
| }) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... this is concerning.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just never had the need to fully teardown everything, so that functionality didn't come "for free" with the existing code (think about it - we usually render the reporter, and never tear it down, in the existing runner). I think this should be an easy fix.
Can look into this in the mean time while you get your spec list PR ready.