How to write UI manual test case for longer webpage? - user-interface

I'm to write UI test case for the homepage for a web application. the home page is very long. How to write Manual UI test cases for the home page? It's for http://www.jarviz.com
Can anyone help me with this? Thank you.

1) Try to divide web page to separate section/parts like a) Main Menu, b) Login/Sign Up, c) Make Your Move section d) Your applications, our platform etc.
2) Then for each part try to exclude single element. For example Main Menu button, or Login button, or Top Banner Control buttons.
3) Then write test cases for each element and action that you can do with the element.
Simple example:
Title: Pressing of the Main Menu button; Precondition: Web page should be opened; Steps to reproduce: Click on Main Menu button; Expected Result: Side Main Menu should be presented on the screen; Actual result: the same - Side Main Menu should be presented on the screen.
Try to use Google Sheets for your test cases.

Related

How to implement direct transitions between sibling pages in Xamarin.Forms with ReactiveUI?

I need to implement the routing functionality in Xamarin.Forms application using the ReactiveUI framework.
The following transitions map needs to be implemented:

Above the black arrows show forward transitions (e.g. I go from the Menu to the Order page by clicking on the menu item button), while the red arrows are for Go Back functionality. Please note that Go back should work for both: (a) the "Go back" link in the top navigation bar (b) the hardware «Back» button on the Android devices.
How do I implement the transitions between sibling pages like these:
Menu - Order - Map - Back to the Menu
Menu - Order - Order details - Pin details page - Back to the Map - Back to the Menu
?
P.S. Here is the guide https://www.reactiveui.net/docs/handbook/routing/ I followed recently, so I used GoNext/GoBack commands to implement more simple transitions like Menu - Order - Order details - Back to the Order - Back to the Menu. It does not work well for the described case, as the Back buttons make transitions back to the previous page instead of their parent page in the navigation map.
The NavigateBack command implementation is quite simple in ReactiveUI's RoutingState, it just removes the last element from the RoutingState.NavigationStack, RoutingState.NavigationStack is an instance of ObservableCollection<IRoutableViewModel>.
So in your particular case, you could write your own NavigateBack command implementation that mutates the navigation stack as required by your application domain. You could use a switch block to figure out what page is currently shown in the screen, and then map that page into another page, either newly created or stored in a field or in a Locator.Current. Probably your command will require a more complex canExecute implementation as well.
ReactiveCommand<Unit, IRoutableViewModel> navigateBackDomainAware =
ReactiveCommand.CreateFromObservable(() => {
var currentViewModel = NavigationStack[NavigationStack.Count - 1];
if (currentViewModel is PinDetailsViewModel) {
var mapViewModel = GetMapViewModel();
NavigationStack.Add(mapViewModel); // The navigation.
return Observable.Return(mapViewModel);
} else {
// Handle other pages. You can also put some domain-specific code
// describing the navigation mappings in your application here.
}
});

Top menu works with tabs. Submenu doesn't work with tabs

menu: LUCAS base_url('lucas'). submenu: deel_1 (base_url('lucas/view/1'). In controller two functions (index($choice="all) and view($choice) are going to the same view folder/page. In this page I load the particular part(lucas_tabrow_1, 2 or lucas_tabrow_all) Only the last one works! The tqo not working are coming from the submenu! Hovering over a tabrow part shows in the status: localhost/lucas/view/1#. The correct one shows: localhost/lucas#
I tried to make a tabrow with 10 menus / dropdown menus. This is too big so I try to make 2 tabrows and only load one at the time. Clicking on topmenu Lucas goes correct, but trough submenu it doesnn't work

How to verify element displays in new window after clicking a link on the main window

I am using Cypress to click a link on the Homepage which opens the respective page in the new window. I am not able to identify any element on this page. I am doing this to verify that the click opens the correct page.
I saw the link: Access a new window - cypress.io which didn't help much to answer the problem.
Please suggest if there is some way to test this.
I have tried few things like:
cy.window().contains('.div.trItem')
cy.window().its('.trValue).should('eq','SomeHeading')
cy.url().should('include', '/theLink1.html/')
Expected:
- Clicking link open the correct page in new window
- Identify URL in new window includes some text
- Certain text displays on the new window
First of all, you can't access to another tab or window with Cypress. Consider to separate your test cases. For example, in one test you could check that a element contains href attribute with expected url and target attribute with _blank.
Like this:
it('contains valid a element', () => {
cy.visit('https://example.cypress.io/')
cy.contains('Cypress.io').should('have.attr', 'href', 'https://www.cypress.io').should('have.attr', 'target', '_blank')
})
And in second test check that your other page contains expected text.

Targeting a new tab in Selenium

I have a test which essentially will click a link on the footer of the page. We have three of them and they all lead to different places:
A Google Docs form
A training page
A licensing page
The code below makes the right assertions and clicks the link:
if #link_selection.eql?('leave feedback')
#wait.until {#driver.find_element(css: => 'cell.feedback').click}
#wait.until {#driver.find_element(css: => 'a[href="https://docs.google.com/a/showmyhomework.co.uk/forms/d/1LP8BZ950TSXXDR1HuVz7yhv9Cp3h6scmQtNFqIRW_XI/viewform"').click}
puts "Leave feedback link clicked"
I've modularised it for each different link location.
When the link is clicked, it naturally opens in a new browser tab. I then wanted to extend the test to then view the tab which was opened and then make an assertion on that page. I wanted to ask how I can handle a new tab in Selenium and the way in that:
a. It asserts that the new tab is open (and switches to it)
b. It can then assert a heading or title of the page (so that the test is sure that the page has been opened.
The following code in c#, please feel free to change it to ruby.
// This gets the window handles of open available windows(also, tabs)
var availableWindows= driver.WindowHandles;
To switch to the new tab with respect to the title of the page:
string Title= "whateveryourpagetitleis";
foreach (string windowId in availableWindows)
{
string windowTitle = driver.SwitchTo().Window(windowId).Title;
if (windowTitle.ContainsIgnoreCase(title))
{
driver.SwitchTo().Window(windowId);
}
}
You can play around with the functions and then use your asserts accordingly. But, what you're looking for is WindowHandles

Visually editing code or open a program on test start

I'm pretty new to Coded UI Tests and after searching through documentation , I've failed to find a solution to this.
Is it possible to visually ( Like when I recorded the test ) edit the code/steps after it has been generated, or, introduce new steps ?
Is there a way to set the Test to open Internet Explorer with a specific URL as the Test begins ? ( Different from Windows Key + Clicking on the icon in the menu bar )
Your screenshot shows the UI Map Editor of Coded UI. From there you can make many changes to the recorded tests.
To record new steps and new assertions to go into an existing Coded UI test do the following. In the [TestMethod] in the ".cs" file put the cursor where the calls to the new code should be placed, I like to add a blank line at that place to make it precisely clear to me where the new item is added. Use the context (right click) menu and select "Generate code for Coded UI test" => "Use Coded UI test builder". Then use the record and generate tools just as when the test was first recorded.
I removed the steps from the UI Map Editor and added this line to the [TestMethod].cs file
[TestInitialize()]
public void BrowserStarter()
{
BrowserWindow browser = BrowserWindow.Launch(new Uri("http://www.google.com"));
}

Resources