Editing Clone modification vs. dom modification This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <html> <body> <div id="content"><div class="post_all"></div></div> <div id="templateArea"> <div class="post_all transform_translatez"> <div class="avatar transform_translatez"></div> <div class="post"> <div class="left-triangle"></div> <div class="header"> <div class="name"></div> <div class="date"></div> <div class="sticker"></div> </div> <div class="text_wrapper"></div> <div class="media"></div> <div id="editPostPlaceholder" class="transform_translatez"></div> <div class="stats"> <div class="stat"><span class="likes">0</span> <div class="icon_like" onclick="alert('List of likers')"/></div> <div class="stat"><span class="comment_count">0</span> <div class="icon_chat" onclick="alert('List of commentators')"/></div> <div class="stat"><span class="shares">0</span> <div class="icon_share" onclick="alert('List of sharers')"/></div> </div> <div class="actions"> <div class="icon_excla" onclick="alert('Reported')"/> <div class="icon_edit" class="editPost"/> <div class="icon_delete" class="deletePost"/> <div class="icon_chatshare" class="chatShare"/> <div class="icon_share" onclick="alert('Shared')"/> <div class="icon_like" class="likePost"/> </div> </div> <div class="comment_btn_container"> <div class="see_all_comments">See all</div> <div class="see_new_comments">See newest</div> <div class="loading_comments_top"></div> </div> <div class="comments"></div> <div class="loading_comments_bottom"></div> <div class="comment_btn_container"> <div class="see_new_comments_with_scroll">See newest</div> </div> <div class="update_btn_container"> <div class="update_btn">See new</div> <div class="loading_item_update"></div> </div> <div class="make_comment_area transform_translatez"> <div class="avatar transform_translatez"></div> <div class="comment_box_wrapper"> <div class="left-triangle"></div> <div class="comment_box"></div> </div> </div> <div class="clear"></div> </div> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> </body> </html> Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) var $content = $("#content"), $templateArea = $("#templateArea"), $template = $templateArea.find(".post_all"); var $clone = $template.clone(); Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code $template.find(".avatar").html("a").css('height','10px'); $template.find(".name").html("Aske"); $template.find(".date").html("now"); $template.find(".text_wrapper").html("Textytext"); $template.find(".media").html("<img src=''>"); $template.find(".likes").html("1"); $template.find(".comment_count").html("2"); $template.find(".shares").html("3"); $template.find(".comments").html("<div>comment</div>"); Test 2 Title Async (check if this is an asynchronous test) Code $clone.find(".avatar").html("a").css('height','10px'); $clone.find(".name").html("Aske"); $clone.find(".date").html("now"); $clone.find(".text_wrapper").html("Textytext"); $clone.find(".media").html("<img src=''>"); $clone.find(".likes").html("1"); $clone.find(".comment_count").html("2"); $clone.find(".shares").html("3"); $clone.find(".comments").html("<div>comment</div>"); $template.replaceWith($clone);