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

Add tests for custom bridge GUI #6136

Merged
merged 7 commits into from
Apr 19, 2024
Merged

Conversation

raksooo
Copy link
Member

@raksooo raksooo commented Apr 16, 2024

This PR adds tests for the custom bridge GUI. When implementing the tests I also noticed that the bridge type wasn't set to normal when "Automatic was selected". This has also been fixed in this PR.


This change is Reviewable

Copy link

linear bot commented Apr 16, 2024

@raksooo
Copy link
Member Author

raksooo commented Apr 16, 2024

Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 3 of 3 files at r4, 1 of 1 files at r5, 1 of 1 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @raksooo)


gui/test/e2e/installed/state-dependent/custom-bridge.spec.ts line 86 at r4 (raw file):

  await inputs.nth(1).fill('443');
  await expect(addButton).toBeEnabled();

Is there a particular reason why '443' is hardcoded here? Can we use SHADOWSOCKS_SERVER_PORT instead? 😊

Code quote:

  await inputs.nth(1).fill('443');
  await expect(addButton).toBeEnabled();

test/test-manager/src/tests/helpers.rs line 256 at r5 (raw file):

/// This will first check whether we are logged in. If not, it will also try to login
/// on your behalf. If this function returns with any errors, it means that we are logged in
/// to.

Reading my own comment here is painful, I must have been so tired 😂

Anyway, I think this comment is misleading. It should say "If this function returns without any errors, we are logged in to a valid account" or something along those lines 😊

Code quote:

/// This will first check whether we are logged in. If not, it will also try to login
/// on your behalf. If this function returns with any errors, it means that we are logged in
/// to.

test/test-manager/src/tests/ui.rs line 209 at r6 (raw file):

    )
    .await
    .map_err(|_| Error::DaemonNotRunning)??;

Tip Cleaning up modified environment variables should no longer be necessary as of this commit.

If you have seen issues related to this lately, please file a bug report about it 😊

Code quote:

    // Reset the `api-override` feature.
    tokio::time::timeout(
        std::time::Duration::from_secs(60),
        rpc.set_daemon_environment(helpers::get_app_env()),
    )
    .await
    .map_err(|_| Error::DaemonNotRunning)??;

@raksooo raksooo force-pushed the add-custom-bridge-test-des-820 branch from 02470a6 to 6499729 Compare April 18, 2024 14:22
Copy link
Member Author

@raksooo raksooo left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MarkusPettersson98)


gui/test/e2e/installed/state-dependent/custom-bridge.spec.ts line 86 at r4 (raw file):

Previously, MarkusPettersson98 (Markus Pettersson) wrote…

Is there a particular reason why '443' is hardcoded here? Can we use SHADOWSOCKS_SERVER_PORT instead? 😊

I used 443 since in a later test we edit the method and I wanted something to change in the edit 😆 We never actually connect so we could use bogus values as well.


test/test-manager/src/tests/helpers.rs line 256 at r5 (raw file):

Previously, MarkusPettersson98 (Markus Pettersson) wrote…

Reading my own comment here is painful, I must have been so tired 😂

Anyway, I think this comment is misleading. It should say "If this function returns without any errors, we are logged in to a valid account" or something along those lines 😊

Done.


test/test-manager/src/tests/ui.rs line 209 at r6 (raw file):

Previously, MarkusPettersson98 (Markus Pettersson) wrote…

Tip Cleaning up modified environment variables should no longer be necessary as of this commit.

If you have seen issues related to this lately, please file a bug report about it 😊

Done.

Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 8 files at r8, 8 of 8 files at r9, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


gui/test/e2e/installed/state-dependent/custom-bridge.spec.ts line 86 at r4 (raw file):

Previously, raksooo (Oskar Nyberg) wrote…

I used 443 since in a later test we edit the method and I wanted something to change in the edit 😆 We never actually connect so we could use bogus values as well.

Alright!

@raksooo raksooo force-pushed the add-custom-bridge-test-des-820 branch 2 times, most recently from 1e6b5bd to 5d2e506 Compare April 19, 2024 09:28
@raksooo raksooo force-pushed the add-custom-bridge-test-des-820 branch from 5d2e506 to 9931f2c Compare April 19, 2024 09:35
@raksooo raksooo merged commit eced118 into main Apr 19, 2024
33 of 34 checks passed
@raksooo raksooo deleted the add-custom-bridge-test-des-820 branch April 19, 2024 09:51
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.

2 participants