Skip to content
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

Fix E2E tests #76

Draft
wants to merge 20 commits into
base: trunk
Choose a base branch
from
Draft

Fix E2E tests #76

wants to merge 20 commits into from

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented May 2, 2024

Update: Rebased on top of #99. The diff is noisy because it includes the changes from #17, too.


Works on my machine™

image

Let's see what CI does...


Related to #

Proposed Changes

Testing Instructions

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

<div
className="flex flex-row flex-grow"
data-testid="onboarding"
>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could actually remote this, given the current code doesn't use it because I couldn't get it to work.

const frontendUrl = await siteContent.frontendButton.textContent();
expect( frontendUrl ).toBeTruthy();
expect( frontendUrl ).not.toBeNull();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to make this "to not be empty"

e2e/sites.test.ts Outdated Show resolved Hide resolved
Comment on lines 18 to 38
get siteNameInput() {
return this.locator.getByLabel( 'Site name' );
}

get sitePathInput() {
return this.locator.getByLabel( 'Local path' );
}

get continueButton() {
return this.locator.getByRole('button', { name: 'Continue' });
}

private get localPathButton() {
return this.locator.getByTestId( 'select-path-button' );
}

// This usually opens an OS folder dialog, except we can't interact with it in playwrite.
// In tests the dialog returns the value of the E2E_OPEN_FOLDER_DIALOG environment variable.
async clickLocalPathButtonAndSelectFromEnv() {
await this.localPathButton.click();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of this logic is duplicated from add-site-modal.ts. I shall extract it in a site-form.ts object, but maybe in a followup PR. Very keen to get E2E back to stable in CI.

@mokagio mokagio mentioned this pull request May 8, 2024
1 task
@mokagio mokagio changed the base branch from mokagio/macos-e2e-tests to mokagio/e2e-fix-locally May 9, 2024 02:47
mokagio added a commit that referenced this pull request May 16, 2024
In #17 ,
6619e75 , we duplicated the logic to
run unit tests and linters on Buildkite.

After running them side by side for a few days, no issues have been
reported.

It's now time to remove the GitHub Actions step.

See #99 and
#76 for the E2E counterpart.
wojtekn pushed a commit that referenced this pull request May 16, 2024
In #17 ,
6619e75 , we duplicated the logic to
run unit tests and linters on Buildkite.

After running them side by side for a few days, no issues have been
reported.

It's now time to remove the GitHub Actions step.

See #99 and
#76 for the E2E counterpart.
Base automatically changed from mokagio/e2e-fix-locally to trunk May 17, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant