Although it is recognized that failure of glassy polymers involves crazing and shear yielding, most of the studies of their fracture account for one or the other mechanism. We present a finite element analysis in which crazing and shear yielding are incorporated. Shear yielding is accounted for through the description of a three-dimensional constitutive law of the bulk material, while crazing is modeled by a cohesive surface which comprises the three stages of initiation, thickening, and craze fibril breakdown and related crack formation. The description is able to capture the main features of glassy polymer fracture such as the ductile-to-brittle transition at low rates and the evolution of the toughness with loading rate. In particular, it is demonstrated that the competition between shear yielding and crazing governs the material's toughness. Even if the description of crazing presented here is essentially phenomenological, a cohesive zone formulation is shown to provide a consistent formulation to bridge descriptions of failure at the molecular length scale with analyses performed at the continuum scale.