Skip to content
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

Implement Regression tests #3

Open
PoLaKoSz opened this issue Oct 24, 2018 · 0 comments
Open

Implement Regression tests #3

PoLaKoSz opened this issue Oct 24, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@PoLaKoSz
Copy link
Owner

Live calls to the webpage

  • Compare the hard coded object (refreshed before started the tests) with the parsed response;
  • Call modification endpoints and validate that the endpoint still exists and change what is should change (for eg.: number of messages in the InBox, add/edit/delete phone number(s), etc.).

Example:

class User : Student
{
    public string Name { get; }
    public int BankAccountBalance { get; }
    public ISchool School { get; }
    public List<Message> Messages { get; }



    public User()
    {
        Name = "Tom PoLáKoSz";
        BankAccountBalance = 20000;
        School = new ObudaiEgyetem();
        Messages = new List<Message>()
        {
            ...
        };
    }
}

...

[TestMethod]
public async void SampleRegressionTests()
{
    _user = new User();

    var loginPage = new LoginPage(_user.School);
    var messagesPage = new MessagesPage(_user.School);

    int maxTryNumber = await loginPage.GetMaxTryNumber();
    await loginPage.LogIn(_user);

    List<Message> messages = await messagesPage.InBox();
    Message specificMessage = await messagesPage.GetMessage(messages[0]);

    CompareSpecificMessage(_user.Messages[0], specificMessage);// maybe this is not valid
    ...
}

[DataSource]
[DataRow(expexted, actual)]
private void CompareSpecificMessage(Message expected, Message actual)
{
    Assert.AreEqual(expected, actual);
}
@PoLaKoSz PoLaKoSz added the enhancement New feature or request label Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant