Fixed nested condition validation problem

Jira-issue: WP-1080
Added new tests

Added tests related to
- environment tag
- nested condition tag

Jira-issue: WP-1080