Fix playwright tests locally (#32974)
This commit is contained in:
@@ -122,7 +122,7 @@ test.describe("HTML Export", () => {
|
|||||||
await download.saveAs(zipPath);
|
await download.saveAs(zipPath);
|
||||||
|
|
||||||
const zip = await extractZipFileToPath(zipPath, dirPath);
|
const zip = await extractZipFileToPath(zipPath, dirPath);
|
||||||
await page.goto(`file://${dirPath}/${Object.keys(zip.files)[0]}/messages.html`);
|
await page.goto(`file://${dirPath}/${Object.keys(zip.files).find((f) => f.endsWith("/messages.html"))}`);
|
||||||
await expect(page).toMatchScreenshot("html-export.png", {
|
await expect(page).toMatchScreenshot("html-export.png", {
|
||||||
mask: [page.locator(".mx_TimelineSeparator")],
|
mask: [page.locator(".mx_TimelineSeparator")],
|
||||||
css: `
|
css: `
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ interface Props {
|
|||||||
scope: SearchScope;
|
scope: SearchScope;
|
||||||
inProgress: boolean;
|
inProgress: boolean;
|
||||||
promise: Promise<ISearchResults>;
|
promise: Promise<ISearchResults>;
|
||||||
abortController?: AbortController;
|
|
||||||
className: string;
|
className: string;
|
||||||
onUpdate(this: void, inProgress: boolean, results: ISearchResults | null, error: Error | null): void;
|
onUpdate(this: void, inProgress: boolean, results: ISearchResults | null, error: Error | null): void;
|
||||||
ref?: Ref<ScrollPanel>;
|
ref?: Ref<ScrollPanel>;
|
||||||
@@ -48,16 +47,7 @@ interface Props {
|
|||||||
|
|
||||||
// XXX: todo: merge overlapping results somehow?
|
// XXX: todo: merge overlapping results somehow?
|
||||||
// XXX: why doesn't searching on name work?
|
// XXX: why doesn't searching on name work?
|
||||||
export const RoomSearchView = ({
|
export const RoomSearchView = ({ term, scope, promise, className, onUpdate, inProgress, ref }: Props): JSX.Element => {
|
||||||
term,
|
|
||||||
scope,
|
|
||||||
promise,
|
|
||||||
abortController,
|
|
||||||
className,
|
|
||||||
onUpdate,
|
|
||||||
inProgress,
|
|
||||||
ref,
|
|
||||||
}: Props): JSX.Element => {
|
|
||||||
const client = useContext(MatrixClientContext);
|
const client = useContext(MatrixClientContext);
|
||||||
const roomContext = useScopedRoomContext("showHiddenEvents");
|
const roomContext = useScopedRoomContext("showHiddenEvents");
|
||||||
const [highlights, setHighlights] = useState<string[] | null>(null);
|
const [highlights, setHighlights] = useState<string[] | null>(null);
|
||||||
@@ -144,7 +134,6 @@ export const RoomSearchView = ({
|
|||||||
handleSearchResult(promise);
|
handleSearchResult(promise);
|
||||||
return () => {
|
return () => {
|
||||||
aborted.current = true;
|
aborted.current = true;
|
||||||
abortController?.abort();
|
|
||||||
};
|
};
|
||||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
|
|||||||
@@ -2563,7 +2563,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||||||
term={this.state.search.term}
|
term={this.state.search.term}
|
||||||
scope={this.state.search.scope}
|
scope={this.state.search.scope}
|
||||||
promise={this.state.search.promise}
|
promise={this.state.search.promise}
|
||||||
abortController={this.state.search.abortController}
|
|
||||||
inProgress={!!this.state.search.inProgress}
|
inProgress={!!this.state.search.inProgress}
|
||||||
className={this.messagePanelClassNames}
|
className={this.messagePanelClassNames}
|
||||||
onUpdate={this.onSearchUpdate}
|
onUpdate={this.onSearchUpdate}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ IMAGE_NAME="ghcr.io/element-hq/element-web/playwright-server:$PW_VERSION"
|
|||||||
docker pull "$IMAGE_NAME" 2>/dev/null || build_image "$IMAGE_NAME"
|
docker pull "$IMAGE_NAME" 2>/dev/null || build_image "$IMAGE_NAME"
|
||||||
|
|
||||||
# Start the playwright-server in docker
|
# Start the playwright-server in docker
|
||||||
CONTAINER=$(docker run --network=host --rm -d -e PORT="$WS_PORT" "$IMAGE_NAME")
|
CONTAINER=$(docker run --network=host -v /tmp:/tmp --rm -d -e PORT="$WS_PORT" "$IMAGE_NAME")
|
||||||
# Set up an exit trap to clean up the docker container
|
# Set up an exit trap to clean up the docker container
|
||||||
clean_up() {
|
clean_up() {
|
||||||
ARG=$?
|
ARG=$?
|
||||||
|
|||||||
Reference in New Issue
Block a user