Skip to content

Commit

Permalink
add DeviceTags scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and kbeaugrand committed Mar 19, 2023
1 parent 68ad87c commit 80391ca
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/AzureIoTHub.Portal.Tests.E2E/DeviceTags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (c) CGI France. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace AzureIoTHub.Portal.Tests.E2E
{
using AutoFixture;
using AzureIoTHub.Portal.Tests.E2E.Pages;
using NUnit.Framework;
using NUnit.Framework.Internal;

public class DeviceTags : E2ETest
{
private LoginPage loginPage;

[SetUp]
public void SetUp()
{
loginPage = new LoginPage(Configuration);

loginPage.Login();
}

[TearDown]
public override void TearDown()
{
loginPage.Logout();

base.TearDown();
}

[Test]
public void UserCanAddAndRemoveDeviceTag()
{
var fixture = new Fixture();

var tagName = new string(
fixture.CreateMany<char>(4)
.Where(c => char.IsLetterOrDigit(c))
.ToArray()
);

var tagLabel = new string(
fixture.CreateMany<char>(4)
.Where(c => char.IsLetterOrDigit(c))
.ToArray()
);

var tag = new TagsPage();

tag.AddTag(tagName, tagLabel);

tag.RemoveTag(tagName);
}
}
}

0 comments on commit 80391ca

Please # to comment.