-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ci(e2e): Refactor Media helper to better handle concurrency #55678
Conversation
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-13430 |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
b14c839
to
9ea22cf
Compare
`( | ||
`Confirm $block.blockName block is visible in published post`, | ||
async ( { block, content } ) => { | ||
// Pass the Block object class here then call the static method to validate. | ||
await block.validatePublishedContent( page, content ); | ||
} | ||
); | ||
|
||
it( `Confirm Logso block is visible in published post`, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A side effect of the main change (move createTestImage
inside a hook) is that we can't use logoImage
to define a parameter anymore, as it doesn't exist when the test is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bummer, but small price to pay for this change.
@@ -78,39 +79,37 @@ export function createTestFile( { | |||
const sourceFileDir = path.join( __dirname, '../../../../../test/e2e/image-uploads/' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outside the scope of this PR, but we should really refactor this out. A package shouldn't need to have knowledge of the directory structure of the project using said package. Instead, this path should come as part of sourceFileName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the EPERM issues resolved, another solution (that was originally intended) could be to have an image-source
directory in this package which holds the test files.
How does that sound?
} ); | ||
|
||
it( `Confirm Audio block is visible in published post`, async () => { | ||
await AudioBlock.validatePublishedContent( page ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AudioBlock.validatePublishedContent()
doesn't check for the content, it only looks for the presence of the <audio>
tag. This was hidden by the previous implementation as block
was type any
, but now it is correctly detected by TypeScript.
cd08e2f
to
e19490b
Compare
Changes proposed in this Pull Request
Refactor Media Helper for Playwright tests to handle concurrency better:
createTestFile
will use the temp directorycreateTestFile
is now asyncAfter those changes, copying files was still breaking. Looks like removing
--security-opt seccomp=.teamcity/docker-seccomp.json
fixed the problem. I believe we added it for Electron 11 (https://github.com/Automattic/wp-calypso/pull/47555/files) but it is not required here.Testing instructions
Verify e2e still pass