@Test public void testAddAspectInNavBar() { GIVEN("Aspect " + Phrases.ASPECT1 + " is not used by author"); Diaspora.ensureSignInAs(Users.Pod2.bob); Aspects.ensureNoAspect(Phrases.ASPECT1); GIVEN("Post in aspect " + Phrases.ASPECT1 + " does not exist"); Feed.ensureNoPost(Users.Pod2.bob, Phrases.POST_IN_ASPECT1); WHEN("New aspest is added"); NavBar.openMyAspects(); Aspects.add(Phrases.ASPECT1); Contacts.assertAspect(Phrases.ASPECT1); // this check for wait moment when operation is done EXPECT("Added aspect is shown in Nav Bar"); Menu.openStream(); waitStreamOpening(); // this wait for wait moment when stream will be loaded NavBar.openMyAspects(); Aspects.assertAspectInNavBar( Phrases.ASPECT1); // this check for wait moment when stream will be loaded THEN("New aspect can be used for contact setup"); Menu.search(Users.Pod2.sam.fullName); Contact.ensureAspectsForContact(Phrases.ASPECT1); EXPECT("New aspect can be used for post setup"); Menu.openStream(); Feed.addAspectPost(Phrases.ASPECT1, Phrases.POST_IN_ASPECT1); Feed.assertPost(Users.Pod2.bob, Phrases.POST_IN_ASPECT1); WHEN("New aspect is selected in NavBar aspects list"); NavBar.openMyAspects(); Aspects.toggleAspect(Phrases.ASPECT1); THEN("Limited post in this aspect is shown in stream"); Feed.assertPost(Users.Pod2.bob, Phrases.POST_IN_ASPECT1); EXPECT("Limited in aspect post is available for linked in this aspect user"); Diaspora.ensureSignInAs(Users.Pod2.sam); Menu.search(Users.Pod2.bob.fullName); Feed.assertPost(Users.Pod2.bob, Phrases.POST_IN_ASPECT1); Menu.ensureLogOut(); }
@Test public void testSwitchToEditModeInNavBar() { WHEN("Aspect is in edit mode"); Diaspora.ensureSignInAs(Users.Pod2.bob); NavBar.openMyAspects(); Aspects.switchToEditMode(FRIENDS); THEN("Contact site with this aspect is loaded"); Contacts.assertAspect(FRIENDS); }