Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

JavaScript YUI Test Framework

Author: Mansoor Ahmed
by Mansoor Ahmed
Posted: Aug 10, 2021
Introduction

JavaScript YUI Test Framework is one of the greatest standard JavaScript unit testing frameworks. It is a share of the Yahoo! User Interface (YUI). It may be used to test any independent JavaScript code. That does not practice the YUI library. YUI Test delivers a simple syntax for creating JavaScript test cases. Those may run also from the browser or from the command line. They likewise provide a fresh mechanism for testing asynchronous (Ajax) JavaScript code.

We will find ourselves acquainted with the YUI Test syntax if we are used to the syntax of xUnit frameworks for example JUnit. There are changed methods to display test results in YUI Test. We can show the test results in the browser console or develop our custom test runner pages to display the test results. It is better to develop custom test runner pages acceptable to show the test results in all the browsers due to some browsers do not support the console object. The console object is supported in:

  • Firefox with Firebug installed
  • Safari 3+
  • Internet Explorer 8+
  • Chrome
Description

The YUI Library project at Yahoo! was created by Thomas Sha. It was sponsored inside by Yahoo! co-founder Jerry Yang. The library’s developers uphold the YUIBlog. The YUI community debates the library and applications in its community forum.

YUI Test is able as a testing framework for browser-based JavaScript solutions. We can easily add unit testing to our JavaScript solutions by using YUI Test. YUI Test does originate some features from nUnit and JUnit despite the fact not a direct port from any specific xUnit framework.

Features?

The YUI Library is completely documented on its website. Full API documentation goes with the library download. It has six kinds of modules:

  • YUI core
  • Utilities
  • UI controls
  • CSS components
  • Developer tools
  • Build tools

YUI Core?

The YUI Core is a light set of tools for event management and DOM operation.

YUI Global Object

The YUI Global Object covers

  • Language utilities,
  • A script loader
  • Other baseline infrastructure for YUI.

Dom Collection

Supports by common DOM scripting tasks, with element positioning and CSS style management.

Event Utility

Make available developers with easy and safe access to browser events. It similarly offers the Custom Event object for publishing and pledging to custom events.

Utilities?

Animation

Advantages to creating effects by animating the location, size, dullness or other features of page elements.

Browser History Manager

Supports web applications use the browser’s back button and bookmarking functionality.

Connection Manager

Helps manage XMLHttpRequest transactions in a cross-browser fashion. It has integrated provision for form posts, error handling, callbacks and file uploading.

Cookie

Permits us to manage browser cookies and sub cookies through a simple API.

DataSource

Make available a common configurable interface for other components to interact with different types of data.

Drag and drop

The YUI Drag and Drop Utility creates it relaxed to make elements draggable and to make drop targets that reply to drag events.

Element

Offers a wrapper for HTML elements in the DOM. It makes simpler common tasks for example adding listeners, manipulating the DOM, and setting and getting attributes.

Get

The Get Utility helps the asynchronous loading of data. It supports the scripts by script nodes and the dynamic loading of external CSS files.

ImageLoader

YUI’s ImageLoader permits us to give way to the loading of images. Those images are not visible in the viewport at the time the page loads. This may result in big performance boosts.

JSON

The JSON Utility make available methods for validation of incoming JSON data. That is to confirm that it is safe and methods to convert JavaScript data to a JSON-formatted string. These approaches are founded on Douglas Crockford’s work at JSON.org.

Resize

Permits us to make any block-level HTML element resizable.

Selector

The YUI Selector Utility enables us to take references to HTML elements via CSS3 selector syntax.

YUI Loader

YUI Loader is a client-side loader engine. It can dynamically load any YUI component and dependencies on the fly.

Controls

AutoComplete

Make available autocomplete feature for user interactions involving text entry. It helps a variety of data-source formats. It likewise supports server-side data-sources via XMLHttpRequest.

Button

Allows the creation of rich, graphical buttons. Those do function like traditional HTML form buttons.

Calendar

Vibrant and graphical control used for date selection.

Charts

The Charts Control saves data via the DataSource Utility. They show the data in a variety of common chart formats.

Color Picker

The Color Picker Control offers a rich graphical interface for colour selection.

Container

Helps a variety of DHTML windowing patterns. Those are comprising Tooltip, Panel, Dialog, SimpleDialog, Module and Overlay.

DataTable

Modest up till now influential API to display screen-reader accessible tabular data on a web page. Distinguished structures include sortable columns, pagination, scrolling, row selection, resizable columns, and inline editing.

ImageCropper

ImageCropper offers the UI. It shares the elements for a client-side image cropper.

Layout Manager

Enables us to make cross-browser, pixel-perfect layouts with little effort by given that a fixed layout covering, top, bottom, and left, right and centre layout units.

Menu

Gives an easy API for making fly-out menus, menu bars, and context menus.

Rich Text Editor

The Rich Text Editor is a classy client-side text processor. It is modular and highly configurable, appropriate for any open-ended text entry condition.

Slider

Delivers a generic slider element. That element allows the user to select within a finite range of values on one or two axes.

TabView

Supplies navigable tabbed views of content. They support dynamic loading of tab content via XMLHttpRequest.

TreeView

Yields a content tree whose nodes may be prolonged and contracted.

Uploader

Permits for a multi-file file upload by feedback on upload progress.

CSS resources

CSS Base

Use Base after Reset to make available a consistent, cross-browser spare for the normal browser CSS rules to which web developers are familiar.

CSS Grids

Seven basic page wireframes with subsection modules to help over 1000 different page layouts.

CSS Fonts

Consistent cross-browser font families and size version.

CSS Reset

CSS declarations eliminate margins. They regulate cross-browser rendering on common elements.

Developer tools

Logger

Gives a rapid and easy way to write log messages to an on-screen console.

Profiler

A cross-browser, non-visual code profiler for JavaScript.

ProfilerViewer

Used in grouping with Profiler to deliver rich visualizations of our profiling data

Build tools

YUI Compressor

YUI Compressor is a tool that minifies JavaScript and CSS without harm.

YUIDoc

YUIDoc is a tool written in JavaScript. It creates searchable API documentation of JavaScript code. It is naturally used as part of a build process. YUIDoc is comment-driven. They are compatible with a variety of coding styles and programming languages.

For more details visit: https://www.technologiesinindustry4.com/2021/08/javascript-yui-test-framework.html

About the Author

Mansoor Ahmed Chemical Engineer,Web developer

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Mansoor Ahmed

Mansoor Ahmed

Member since: Oct 10, 2020
Published articles: 124

Related Articles