-
Notifications
You must be signed in to change notification settings - Fork 1
Implement RPC-based plugin system to fix version mismatch issues #3
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
Changes from all commits
b68c831
e6d77c4
7ce75c4
aceb778
872266c
08b37e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,3 +32,6 @@ build/ | |
|
|
||
| # Local test data | ||
| testdata/tmp/ | ||
|
|
||
| # Git worktrees | ||
| .worktrees/ | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,230 @@ | ||||||||||||||||||||||||||||||||||||||
| package livepage_test | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| import ( | ||||||||||||||||||||||||||||||||||||||
| "context" | ||||||||||||||||||||||||||||||||||||||
| "fmt" | ||||||||||||||||||||||||||||||||||||||
| "os" | ||||||||||||||||||||||||||||||||||||||
| "os/exec" | ||||||||||||||||||||||||||||||||||||||
| "strings" | ||||||||||||||||||||||||||||||||||||||
| "testing" | ||||||||||||||||||||||||||||||||||||||
| "time" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| "github.com/chromedp/cdproto/network" | ||||||||||||||||||||||||||||||||||||||
| "github.com/chromedp/cdproto/runtime" | ||||||||||||||||||||||||||||||||||||||
| "github.com/chromedp/chromedp" | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // TestInteractiveBlocksE2E verifies that interactive blocks work end-to-end: | ||||||||||||||||||||||||||||||||||||||
| // 1. Page loads without "Connecting..." message | ||||||||||||||||||||||||||||||||||||||
| // 2. Interactive blocks are rendered | ||||||||||||||||||||||||||||||||||||||
| // 3. User can interact (increment/decrement counter) | ||||||||||||||||||||||||||||||||||||||
| func TestInteractiveBlocksE2E(t *testing.T) { | ||||||||||||||||||||||||||||||||||||||
| // Build livepage first | ||||||||||||||||||||||||||||||||||||||
| buildCmd := exec.Command("go", "build", "-o", "livepage-test", "./cmd/livepage") | ||||||||||||||||||||||||||||||||||||||
| buildCmd.Dir = "/Users/adnaan/code/livetemplate/livepage" | ||||||||||||||||||||||||||||||||||||||
| if err := buildCmd.Run(); err != nil { | ||||||||||||||||||||||||||||||||||||||
| t.Fatalf("Failed to build livepage: %v", err) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| defer os.Remove("/Users/adnaan/code/livetemplate/livepage/livepage-test") | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // Start the server | ||||||||||||||||||||||||||||||||||||||
| serverCmd := exec.Command("/Users/adnaan/code/livetemplate/livepage/livepage-test", "serve", "examples/counter", "--debug") | ||||||||||||||||||||||||||||||||||||||
| serverCmd.Dir = "/Users/adnaan/code/livetemplate/livepage" | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+32
|
||||||||||||||||||||||||||||||||||||||
| buildCmd.Dir = "/Users/adnaan/code/livetemplate/livepage" | |
| if err := buildCmd.Run(); err != nil { | |
| t.Fatalf("Failed to build livepage: %v", err) | |
| } | |
| defer os.Remove("/Users/adnaan/code/livetemplate/livepage/livepage-test") | |
| // Start the server | |
| serverCmd := exec.Command("/Users/adnaan/code/livetemplate/livepage/livepage-test", "serve", "examples/counter", "--debug") | |
| serverCmd.Dir = "/Users/adnaan/code/livetemplate/livepage" | |
| buildCmd.Dir = "." | |
| if err := buildCmd.Run(); err != nil { | |
| t.Fatalf("Failed to build livepage: %v", err) | |
| } | |
| defer os.Remove("./livepage-test") | |
| // Start the server | |
| serverCmd := exec.Command("./livepage-test", "serve", "examples/counter", "--debug") | |
| serverCmd.Dir = "." |
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.
Hardcoded absolute path makes this test non-portable. Consider using
filepath.Join(".", "livepage-test")or building the path relative to the current directory.