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(tests): fix broken browser tests #7324

Merged
merged 3 commits into from
Jul 24, 2023

Conversation

rachel-fenichel
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Proposed Changes

  • Change offset math to offset by a fixed amount from top-left, rather than a percent
  • Use correct input for one of the tests (DO0 instead of IF0)
  • Use a different category for one of the drag tests, because one of the blocks in the category was broken. That broken block is also fixed in a different PR/set of PRs.
  • Switched from the 'landing' reporter, which the mocha documentation calls a 'gimmick', to one that prints the names of tests to the console as it runs.

Behavior Before Change

Tests worked for Beka but not for me

Behavior After Change

Hopefully tests work for everyone

Reason for Changes

Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

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

Works on my machine too!

);
chai.assert.equal((await getAllBlocks(browser)).length, i);
await dragNthBlockFromFlyout(browser, 'Align', 0, 250, 50 * i);
chai.assert.equal(i, (await getAllBlocks(browser)).length);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It should be the actual vaue and then the expecte value (swap le arguments).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. My expectations were backwards!

50 * i
);
chai.assert.equal((await getAllBlocks(browser)).length, i);
await dragNthBlockFromFlyout(browser, 'Align', 0, 250, 50 * i);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was there a reason this needed to be switched out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One of the basic blocks was breaking (I think it's one that you fixed in dev-tools) and it was making testing difficult.

I want to have a different test to validate that every test block can be shown in the toolbox and dragged in, but this particular test doesn't actually care which block you use.

@@ -182,7 +182,7 @@ suite('Disabling', function () {
110,
110
);
await connect(browser, child, 'PREVIOUS', parent, 'IF0');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Huh, I guess this was just getting it close enough that it was working? lol

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup.

@rachel-fenichel rachel-fenichel enabled auto-merge (squash) July 24, 2023 22:07
@rachel-fenichel rachel-fenichel merged commit c61da55 into google:develop Jul 24, 2023
7 checks passed
@rachel-fenichel rachel-fenichel deleted the fix_broken_tests branch July 24, 2023 22:10
cpcallen added a commit to cpcallen/blockly that referenced this pull request Aug 2, 2023
The test plan specified to use a block from the Basic Blocks
category of the test blocks.

PR google#7324 changed the test in a way that violated the plan,
albeit in aid of a good cause: the basic blocks category had
become unusable due to a bug in the test blocks combined with
better error checking (in PR google#7289).

Since the test blocks were fixed by google/blockly-samples#1774
(and the fix published and Blockly updated by PR google#7313) this
violation can be corrected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants