1# Copyright 2014 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from autotest_lib.client.cros.webstore_test import webstore_test
6
7class webstore_SanityTest(webstore_test):
8    """
9    Verifies that the CWS landing page works properly.
10    """
11
12    version = 1
13
14    def section_header(self, name):
15        """
16        Returns the XPath of the section header for the given section.
17
18        @param name The name of the section
19        """
20        return '//div[contains(@class, "wall-structured-section-header")]' + \
21                '/div[text() = "%s"]' % name
22
23    sections = ['Featured', 'More recommendations']
24    wall_tile = '//div[contains(@class, "webstore-test-wall-tile")]'
25    marquee = '//div[contains(@class, "webstore-test-wall-marquee-slideshow")]'
26
27    def run(self):
28        self.driver.get(self.webstore_url)
29
30        for section in self.sections:
31            self.driver.find_element_by_xpath(self.section_header(section))
32        self.driver.find_element_by_xpath(self.wall_tile)
33        self.driver.find_element_by_xpath(self.marquee)
34