diff --git a/devtools/client/inspector/animation/test/browser.ini b/devtools/client/inspector/animation/test/browser.ini index 54144fbeaf1c..ce7fbd58f83b 100644 --- a/devtools/client/inspector/animation/test/browser.ini +++ b/devtools/client/inspector/animation/test/browser.ini @@ -12,5 +12,6 @@ support-files = [browser_animation_animation_list_exists.js] [browser_animation_animation_list_time_tick.js] +[browser_animation_AnimationTarget.js] [browser_animation_empty_on_invalid_nodes.js] [browser_animation_inspector_exists.js] diff --git a/devtools/client/inspector/animation/test/browser_animation_AnimationTarget.js b/devtools/client/inspector/animation/test/browser_animation_AnimationTarget.js new file mode 100644 index 000000000000..b66b3c53ea9d --- /dev/null +++ b/devtools/client/inspector/animation/test/browser_animation_AnimationTarget.js @@ -0,0 +1,32 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test existance and content of animation target. + +add_task(async function () { + await addTab(URL_ROOT + "doc_simple_animation.html"); + const { animationInspector, inspector, panel } = await openAnimationInspector(); + + info("Checking the animation target elements existance"); + const animationItemEls = panel.querySelectorAll(".animation-list .animation-item"); + is(animationItemEls.length, animationInspector.animations.length, + "Number of animation target element should be same to number of animations " + + "that displays"); + + for (const animationItemEl of animationItemEls) { + const animationTargetEl = animationItemEl.querySelector(".animation-target"); + ok(animationTargetEl, + "The animation target element should be in each animation item element"); + } + + info("Checking the content of animation target"); + await selectNodeAndWaitForAnimations(".animated", inspector); + const animationTargetEl = + panel.querySelector(".animation-list .animation-item .animation-target"); + is(animationTargetEl.textContent, "div.ball.animated", + "The target element's content is correct"); + ok(animationTargetEl.querySelector(".objectBox"), + "objectBox is in the page exists"); +}); diff --git a/devtools/client/inspector/animation/test/browser_animation_animation_list_exists.js b/devtools/client/inspector/animation/test/browser_animation_animation_list_exists.js index 483f026a0877..e374af1fffac 100644 --- a/devtools/client/inspector/animation/test/browser_animation_animation_list_exists.js +++ b/devtools/client/inspector/animation/test/browser_animation_animation_list_exists.js @@ -35,6 +35,5 @@ add_task(async function () { // TODO: We need to add following tests after implement since this test has same role // of animationinspector/test/browser_animation_timeline_ui.js // * name label in animation element existance. - // * target node in animation element existance. // * summary graph in animation element existance. });