//go:build webkit package thintest import ( "encoding/json" "os" "os/exec" "testing" ) // TestWebKitRosterAlignment: Paul, staging 991f12d5, Safari on an iPhone: // "Lots of alignment issues here." In WebKit at 390 (3x, touch) and 1280, // light and dark, testdata/roster-geometry.js finds nothing out of line. // Needs EQUIPO_PLAYWRIGHT_CORE. EQUIPO_BROWSER_ARTIFACTS saves the shots. func TestWebKitRosterAlignment(t *testing.T) { core := os.Getenv("EQUIPO_PLAYWRIGHT_CORE") if core == "" { t.Skip("EQUIPO_PLAYWRIGHT_CORE is not set") } r := newAlignRig(t) c := r.inst.Cookie() raw, _ := json.Marshal(map[string]any{"base": r.inst.URL, "cookie": map[string]string{"name": c.Name, "value": c.Value}, "art": os.Getenv("EQUIPO_BROWSER_ARTIFACTS")}) cmd := exec.Command("node", "testdata/roster.mjs") cmd.Env = append(os.Environ(), "EQUIPO_ROSTER="+string(raw)) cmd.Stderr = os.Stderr got, err := cmd.Output() if err != nil { t.Fatalf("webkit: %v", err) } var res map[string]map[string]string if err := json.Unmarshal(got, &res); err != nil { t.Fatalf("webkit output %q: %v", got, err) } if len(res) != 4 { t.Fatalf("webkit measured %d screens, want 4", len(res)) } for screen, phases := range res { for phase, bad := range phases { if bad != "" { t.Errorf("%s %s: %s", screen, phase, bad) } } } }